Hi There!
I have a question of Combining Multipe Related Tables.
Here is the code:
'Private ds As DataSet
Private cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Password="""";User ID=Admin;Data Source=C:\wwwroot\db\universal.mdb;.....)
Private Sub btnFill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFill.Click
Dim da As New OleDbDataAdapter()
grd.DataSource = Nothing
Dim ds As DataSet = New DataSet()
da.SelectCommand = New OleDbCommand()
da.SelectCommand.Connection = cn
da.SelectCommand.CommandType = CommandType.Text
da.SelectCommand.CommandText = "select * from invoice ; select * from order"
da.TableMappings.Add("Table", "Invoice")
da.TableMappings.Add("Table1", "Order")
da.Fill(ds)
'ds.Relations.Add("Invo_order", ds.Tables("invoice").Columns("oid"), ds.Tables("order").Columns("oid"))
grd.DataSource = ds
End Sub
I have a error message when I press "Fill" button:
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
and point out the code "da.Fill(ds)" cannot run.
Can anybody point out the error of these code, I have no idea of this. Exhausted!!
Thank you!
