I'm trying to connect a query I made in the Access
database to populate a grid.I'm using the following code
and I get a error:
Specified cast is not valid.
on the first line below. Any Ideas?
Dim DataAdp As OleDbDataAdapte r = New OleDbDataAdapte r
("GetInvoice s", DBvar)
DataAdp.SelectC ommand.CommandT ype =
CommandType.Sto redProcedure
If Not IsDBNull(DataAd p) Then
Try
DataAdp.Fill(ds , "Invoices")
Catch ex As Exception
MsgBox(ex.Messa ge,
MsgBoxStyle.Cri tical, "Error:")
End Try
GrdInvoices.Dat aSource = dataset.Tables
("Invoices")
End If
ts.MappingName = dataset.Tables
("Invoices").Ta bleName
database to populate a grid.I'm using the following code
and I get a error:
Specified cast is not valid.
on the first line below. Any Ideas?
Dim DataAdp As OleDbDataAdapte r = New OleDbDataAdapte r
("GetInvoice s", DBvar)
DataAdp.SelectC ommand.CommandT ype =
CommandType.Sto redProcedure
If Not IsDBNull(DataAd p) Then
Try
DataAdp.Fill(ds , "Invoices")
Catch ex As Exception
MsgBox(ex.Messa ge,
MsgBoxStyle.Cri tical, "Error:")
End Try
GrdInvoices.Dat aSource = dataset.Tables
("Invoices")
End If
ts.MappingName = dataset.Tables
("Invoices").Ta bleName
Comment