MAcon.Open(); OleDbDataAdapter da = new OleDbDataAdapter("Select Process from [Product Family] Where [Product Name] = @ProductName", MAcon); da.SelectCommand.Parameters.AddWithValue("@Process", ItemCBx.SelectedItem.ToString()); DataTable dtbl = new DataTable(); da.Fill(dtbl); if (dtbl.Rows.Count == 1) { Listbox1.Items.Add(dtbl.Rows[0][0]); } MAcon.Close();
MAcon.Open(); OleDbCommand da = new OleDbCommand("Select Process from [Product Family] Where [Product Name] = @ProductName", MAcon); OleDbDataReader sdr = da.ExecuteReader(); while (sdr.Read()) { Console.WriteLine(sdr[0].ToString()); } MAcon.Close();
Where [Product Name] = @ProductName"
Parameters.AddWithValue("@Process",
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)