R
Rob Richardson
Greetings!
I have a database with a table named Holdings. I has VB.Net create a .xsd
file for it so that I could use a typed dataset with it. The table has 21
rows. If I use ordinary datasets, I get a DataTable object with 21 rows.
If I use a typed dataset, I get a HoldingTable object with 0 rows. What am
I doing wrong? Here's the code:
Dim holdingsAdapter As New OleDbDataAdapter()
Dim holdingsSet As New HoldingsDataSet()
Dim holdingsTable As HoldingsDataSet.HoldingsDataTable
Dim holdingsRow As HoldingsDataSet.HoldingsRow
'Dim holdingsSet As New DataSet()
'Dim holdingsTable As DataTable
'Dim holdingsRow As DataRow
holdingsAdapter.SelectCommand = New OleDbCommand _
("SELECT * FROM Holdings", mDB)
holdingsAdapter.Fill(holdingsSet)
holdingsTable = holdingsSet.Tables(0)
MsgBox("The holdings table has " & holdingsTable.Rows.Count & " rows.")
This code is in a Try block, and no exceptions are thrown. If I used the
typed objects, I get zero rows. If I use the standard ones, I get 21 rows.
Also, I notice that my HoldingsDataSet object has a member named Holdings.
What data type is that member and what is it for?
Thanks very much!
Rob
I have a database with a table named Holdings. I has VB.Net create a .xsd
file for it so that I could use a typed dataset with it. The table has 21
rows. If I use ordinary datasets, I get a DataTable object with 21 rows.
If I use a typed dataset, I get a HoldingTable object with 0 rows. What am
I doing wrong? Here's the code:
Dim holdingsAdapter As New OleDbDataAdapter()
Dim holdingsSet As New HoldingsDataSet()
Dim holdingsTable As HoldingsDataSet.HoldingsDataTable
Dim holdingsRow As HoldingsDataSet.HoldingsRow
'Dim holdingsSet As New DataSet()
'Dim holdingsTable As DataTable
'Dim holdingsRow As DataRow
holdingsAdapter.SelectCommand = New OleDbCommand _
("SELECT * FROM Holdings", mDB)
holdingsAdapter.Fill(holdingsSet)
holdingsTable = holdingsSet.Tables(0)
MsgBox("The holdings table has " & holdingsTable.Rows.Count & " rows.")
This code is in a Try block, and no exceptions are thrown. If I used the
typed objects, I get zero rows. If I use the standard ones, I get 21 rows.
Also, I notice that my HoldingsDataSet object has a member named Holdings.
What data type is that member and what is it for?
Thanks very much!
Rob