Thanks Dmitriy. This is what I did ...
Private Sub FillGrid_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles FillGrid.Click
Dim myFeedersDA As OleDbDataAdapter = New OleDbDataAdapter()
Dim myFeedersDS As DataSet = New DataSet()
Dim myConnectString As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
tbxDataPath.Text)
Dim myFeedersSQL As OleDbCommand = New OleDbCommand("tempgnm",
myConnectString)
myFeedersSQL.CommandType = CommandType.StoredProcedure
myFeedersSQL.CommandTimeout = 30
myFeedersDA.SelectCommand = myFeedersSQL
myConnectString.Open()
myFeedersDA.Fill(myFeedersDS, "tempgnm")
myConnectString.Close()
DataGrid1.DataSource = myFeedersDS
End Sub
This displays headers in grid, but no data - Only one row displays as (null)
and my other records don't display at all.
Can you or anyone else help further?
Thanks again
Graeme
Dmitriy Lapshin said:
Hi,
You should configure an OleDbCommand, specifying the name of the query as
the CommandText and setting the CommandType to StoredProcedure. Then, set
this command as the SelectCommand for an OleDbDataAdapter and use it's Fill
method to populate the table in the dataset.
The above obviously assumes you have a configured OleDbConnection to the MS
Access database.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
Graeme said:
Hi
How do I get data from an MS Access QUERY rather than a table? Below works
OK for a table ...
Dim myFeedersTable As DataTable = myFeedersDS.Tables("Network_Data_Feeder")
Tried a few things, but no go.
Thanks
Graeme