Using WDABase Class With DataGridView
Thanks, Thearon, for the help you gave me on this problem. This code works perfectly:
GetAppDataPath()
Dim strTable As String = "tblBooks"Using oData As New wdaBase
oData.SQL = "qryBooksGridSelect"oData.InitializeCommand()
oData.OpenConnection()
oData.da = New OleDbDataAdapter(oData.cmd)
oData.ds = New DataSet
oData.da.Fill(oData.ds, strTable)
dgv.DataSource = oData.ds
dgv.DataMember = strTable
dgv.Columns(0).Width = 35
dgv.Columns(1).Width = 200
dgv.Columns(2).Width = 250
dgv.Columns(3).Width = 250
End Using
The only question I have relates to the line
"oData.da = New OleDbDataAdapter(oData.cmd)"
I need to insert the Import the OLEDB statements
If I use this line instead...
oData.da = New odata.da(oData.cmd)
I get the error "Type odata.da' is not defined".
Since I am using the database class and da is declared in the class I don't understnd why this is not accepted, and hopefully you canhelp me understand.
Thank you for a great book and the help you have given me in this forum.
Milt
|