load the table data from database into a datagridview
hi, i'm a beginner in vb.net, i tried to create a sample program that loads the table data from oracle database into a datagridview on my vb.net program but the data from the table was not loaded. can i ask a little help regarding this?
the vb6 method of loading table data into a datagrid (set me.dgview.datasource = rs) is not applicable
thanks...
you can send mail here: cleyventh.debelen@phl.fujixerox.com
Status:
Open Nov 25, 2008 - 01:15 AM
datagridview in vb.net
3answers
Answers
Nov 25, 2008 - 02:35 AM
One way possibly you could try is to use the Fill method
So you have your datagrid, lets call it DataGrid1
You would of defined your connection object using OleDbConnection
Next create the OleDbAdapter and here you put in your query
eg (conn is the OleDbConnection object)
Dim adapter As New OleDbDataAdapter("SELECT Field1, Field2 FROM MyTable", conn)
Now define a datatable to populate the grid with
eg
Dim dt As New DataTable("MyTbl")
adapter.Fill(dt)
Now set the datasource of the datagrid
DataGrid1.DataSource = dt
Mar 24, 2009 - 06:51 AM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment