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
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
Nov 25, 2008 - 02:40 AM
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
The Quomon Team
Add New Comment