[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Chris

4/3/2002 10:46:00 AM

Does anyone know if you can use odbc.net provider to bind to a DataGrid like
you can with the SQLProvider and the OleDB provider?

Does someone have an example of this that they could post?

Thanks in advance.


4 Answers

(Hussein Abuthuraya(MSFT))

4/3/2002 10:48:00 PM

0

Chris

4/4/2002 12:05:00 AM

0

I ran this code and only the table headers showed up. Am I not doing
something. Thanks for you help
"Hussein Abuthuraya(MSFT)" <HussAbOnline@microsoft.com> wrote in message
news:Yn2s2C12BHA.2252@cpmsftngxa09...
> Chris,
>
> A Dataset is a generic object that can be bound to a DataGrid regardless
of what provider that is used to Fill it. Here is some sample code:
>
> Dim conn As New OdbcConnection(connection)
> Dim adapter As New OdbcDataAdapter()
> adapter.SelectCommand = new OdbcCommand(query, conn)
>
> Dim ds as New DataSet
> adapter.Fill(ds, "MyTable")
>
> DataGrid1.DataSource = ds.Tables("MyTable")
>
>
>
> Thanks,
> Hussein Abuthuraya
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights. You assume all risk for your use. © 2002 Microsoft Corporation. All
rights reserved
>
> Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>


(Hussein Abuthuraya(MSFT))

4/4/2002 2:01:00 AM

0

Chris

4/4/2002 3:58:00 AM

0

finally got it fixed. Thanks for all the help.
"Hussein Abuthuraya(MSFT)" <HussAbOnline@microsoft.com> wrote in message
news:ZX0Bmu22BHA.2044@cpmsftngxa10...
> Chris,
>
> Have you verified that the table in the dataset has any rows?
>
> After you fill the Dataset add:
>
> MessageBox.Show(ds.Tables("MyTable").Rows.Count)
>
> If the Count is greater than 0 then your table has some rows, if not then
your query returned no rows.
>
>
> Thanks,
> Hussein Abuthuraya
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights. You assume all risk for your use. © 2002 Microsoft Corporation. All
rights reserved
>
> Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>