Hi All,
I am trying to pass execute a Access Query with parameters from VB.Net. It is not extracting any data from the tables nor throwing any errors. I am not able to understand where am I going wrong. Below is my code snippet.
VB.NET:
Private Sub ClientNamecbox_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles ClientNamecbox.SelectedIndexChanged
Dim ParamValue As String = ""
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Docs\Tracker.accdb;")
Dim cmd As New OleDbCommand
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "GetPursuit"
cmd.Parameters.Add("Name", OleDbType.VarWChar).Value = Namecbox.SelectedValue ' Add Parameter
cmd.Connection = con
Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd)
con.Open()
Dim ds As DataSet = New DataSet()
da.Fill(ds, "Tracker")
PNamecbox.ValueMember = ""
PNamecbox.DataSource = ds.Tables("Tracker")
PNamecbox.DisplayMember = "PName"
PNamecbox.ValueMember = "PName"
con.Close()
End Sub
Please guide.
Thanks in advance.
Regards
Sudhir