hi,
Question 1
i am developing a project in C#.Net, and when a form loads data from the SQL client database is added to four combo boxes in the form, i need to change the data in the combo box when the check box is ticked. I wrote a code for this task but it give a value "System.Data.DataRowView" in the combo box.The code i wrote is added below.
code:
if (cBoxITAR.CheckState == CheckState.Checked)
{
db.openConnection();
String query = @"Select FirstName From Employee Where Citizenship = 'US' ";
SqlCommand comm = new SqlCommand(query, DB.getConnection());
SqlDataAdapter da = new SqlDataAdapter(comm);
DataTable dt = new DataTable();
da.Fill(dt);
cmbPI.DataSource = dt;
cmbPI.DisplayMember = "FirstName" + " " + "LastName";
db.closeConnection();
}
else
{
LoadNames();
}
what is the error in this. can someone pin point it for me???
Question 2
if the change were to be added to 4 combo boxes how do i need to change the code.so that when i click the check box the four combo boxes will be updated with new data and then the user can select four different values in those four combo boxes.
how can I change the code for this.
thank you!!