dgThreads.DataSource = ds.Tables["Threads"];
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.
"James Zhuo" <> wrote in message
news:...
> Hi all
>
> I have been developing some web apps using VB.NET for a coupla month.
>
> Until recently I have tried to use C# instead of VB. What i find is that
in
> VB.NET, Collections can be accessed using the dictionary approach for
> example ds.Tables("Threads") as below
>
> Dim DBConnection As New OleDbConnection = "blah .. .. . .. "
> Dim DBCommand As New OleDbCommand(DBQueryString, DBConnection)
> Dim DBAdapter As New OleDbDataAdapter(DBCommand)
> Dim DSThreads As New DataSet()
> DBConnection.Open()
> DBAdapter.Fill(DSThreads, "Threads")
> DBConnection.Close()
> --> dgThreads.DataSource = ds.Tables("Threads")
> dgThreads.DataBind()
>
> What I want to know is how I would do the same thing ds.Tables("Threads")
> using C#. I want to retrieve the table "Threads" that is store in the
> dataset. ds.Tables is a a property that returns a DataTableColletion.
There
> seem to be no straight forward way to access the DataTable that is
contained
> in the collection.
>
> Please help, any suggestion is much appreciated.
>
> Cheer
>
> J
>
>