Thanks BobJanova. Thanks Everyone...
T
tizziCerutti
@tizziCerutti
Posts
-
C# Fill comboBox with DB content -
C# Fill comboBox with DB contentI want to Bind two Columns and populate a ComboBox with it in C#..My code is printing just one. the FirstName. Have tried concatenating the LastName with it but its not working. Can anyone show me how to go about it. Here is my code. Thanks
OleDbCommand cmd = new OleDbCommand("SELECT * FROM ADb", myCon);
OleDbDataAdapter d = new OleDbDataAdapter(cmd);
d.SelectCommand.CommandText = cmd.CommandText.ToString();DataTable dt = new DataTable(); d.Fill(dt); cmbNames.DataSource = dt; cmbNames.DisplayMember = "FirstName";