Thanks Dmitriy. I'll get on with it tomorrow!
"Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote
in message news:uFwKwpg8DHA.1000@TK2MSFTNGP11.phx.gbl...
> Graeme,
>
> > DataGrid1.DataSource = myFeedersDS
>
> Since you bind the grid to a dataset, you have to specify the DataMember
> property value as well. You can do so by using the SetDataBinding method:
>
> DataGrid1.SetDataBinding(myFeedersDS, "tempgnm")
>
> P.S.: you don't need to open and close the connection manually when you
use
> the DataAdapter. It manages the connection state automatically behind the
> scenes.
>
> --
> 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" <maxim@NOSPAMwave.co.nz> wrote in message
> news:O9tJjJc8DHA.2168@TK2MSFTNGP12.phx.gbl...
> > 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 [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com>
wrote
> > in message news:%23SU4kaU8DHA.2332@TK2MSFTNGP10.phx.gbl...
> > > 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" <maxim@NOSPAMwave.co.nz> wrote in message
> > > news:evIfDUU8DHA.2392@TK2MSFTNGP11.phx.gbl...
> > > > 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
> > > >
> > > >
> > >
> >
> >
>