Hi,
This is the first time I am trying to implement parameter query using
VB.net. I am not sure how to use stored procedures. I have written the following code, but it doesnt work. I get all null values but using the same query on database (ACCESS) gives me some records. Can anyone tell me where I am wrong?.
Dim a As OleDb.OleDbCommand
Dim adapter As OleDb.OleDbDataAdapter
Dim query As String
query = New String("SELECT mousedata.mouseid, mousedateofbirth.Birthdate" _
& "FROM mousedata INNER JOIN mousedateofbirth ON mousedata.mouseid = mousedateofbirth.mouseid " _
& "WHERE ((mousedata.Strain) Like '" & strain & "' & '%' Or " _
& "(mousedata.Strain) Is Null);")
a = New OleDb.OleDbCommand()
a.CommandType = CommandType.Text
a.Connection = Me.oledbcon()
a.CommandText = query
adapter = New OleDb.OleDbDataAdapter(a)
ds = New DataSet()
adapter.Fill(ds)
datagrid1.DataSource = ds
Thanks