[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.odbcnet

ODBC.NET RETURNS 0 RECORDS

Christopher Schipper

6/14/2002 7:44:00 PM

The table has 9 records(rows) and with oledb, returned all into datagrid.
Now returns none.

Thanks,

Chris

(single form with 1 datagrid.)
------------------------------------------------------------
Imports Microsoft.Data.Odbc

Public Class Form1
Inherits System.Windows.Forms.Form
Public DV As DataView
Public DS As DataSet
Public DT As DataTable
Public CN As OdbcConnection
Public DA As OdbcDataAdapter
#Region " Windows Form Designer generated code "
#End Region

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load

DT = New DataTable()
DS = New DataSet()
CN = New OdbcConnection()

CN.ConnectionString = "Driver={Sql
Server};Server=localhost;Trusted_connection=true;"

DA = New OdbcDataAdapter()

DA.MissingSchemaAction = MissingSchemaAction.AddWithKey

DA.SelectCommand = New OdbcCommand("SELECT * FROM SomeTable", CN)

DA.Fill(DS, "SomeTable")

DA.Fill(DT)

DataGrid1.SetDataBinding(DS, "Other_Tracking")

End Sub

End Class


2 Answers

(Douglas Laudenschlager [MS])

6/14/2002 10:13:00 PM

0


Christopher,

I notice that you're referring to your table in the DataSet as "SomeTable"
when you fill it, but when you bind the DataSet to the DataGrid, you're
specifying "Other_Tracking" as the DataMember. What is "Other_Tracking"? Do
you intend:

DataGrid1.SetDataBinding(DS, "SomeTable")

-Doug





This posting is provided "AS IS" with no warranties, and confers no rights.

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....

Christopher Schipper

6/14/2002 10:52:00 PM

0

Yes... :) forgot to rename that one...

I however have spent a lot of time on this and decided to go back to the
oledb for now..

Thanks for the response.

Chris


"Douglas Laudenschlager [MS]" <douglasl@online.microsoft.com> wrote in
message news:PxrgBh#ECHA.1380@cpmsftngxa07...
>
> Christopher,
>
> I notice that you're referring to your table in the DataSet as "SomeTable"
> when you fill it, but when you bind the DataSet to the DataGrid, you're
> specifying "Other_Tracking" as the DataMember. What is "Other_Tracking"?
Do
> you intend:
>
> DataGrid1.SetDataBinding(DS, "SomeTable")
>
> -Doug
>
>
>
>
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> 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....
>