private void listWBox_SelectedIndexChanged(object sender, EventArgs e) { string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) try { SqlDataAdapter da = new SqlDataAdapter(); DataTable dt = new DataTable(); con.Open(); SqlCommand sqlcmd = new SqlCommand("readListWBox", con); sqlcmd.CommandType = CommandType.StoredProcedure; da.SelectCommand = sqlcmd; da.Fill(dt); listJobBox.DataSource = dt; } catch (Exception ex) { MessageBox.Show("exception raised"); } finally { con.Dispose(); con.Close(); } }
listJobBox.DisplayMember
DataTable
listJobBox.DisplayMember = "FirstName";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)