|
Leonel
Starting Member
10 Posts |
Posted - 06/20/2012 : 21:48:58
|
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Database\ReturnEquipment.accdb;Persist Security Info=False;")
Dim myCommand = New OleDbCommand("select * from RMA WHERE SN = @SN") myCommand.Connection = conn conn.Open() myCommand.Parameters.AddWithValue("@sn", ComboBox1.SelectedValue) Dim ds As Data.DataSet = New Data.DataSet Dim dr As OleDbDataReader Dim DA As New OleDbDataAdapter dr = myCommand.ExecuteReader myCommand.Connection = conn DA.Fill(ds, "RMA") DataGridView1.DataSource = ds
myCommand.dispose()
con.Close()
End Sub i used this code and i get this error: The SelectCommand property has not been initialized before calling 'Fill'. |
 |
|