Doing that Failuresymp.DataSource = dt1;
The items in the Failuresymp combobox are objects of DataRowView type but in the combobox you should see the values from the dt1.Rows["Symptoms"] where i =0...dt1.Rows.Count;
Next before you build the INSERT statements add the code that I post before.
Do the same for other combobox controls that you need to retrieve the selected string, let say selectedSubAssembly
You should have like here exactly where you build the INSERT statement.
[code
DataRowView item = (DataRowView)Failuresymp.SelectedItem;
if (item !=null)
{
string selectedSymptom = item["Symptoms"].ToString().Trim();
}
item = (DataRowView)SubAssembly.SelectedItem;
if (item !=null)
{
string selectedSubAssembly = item["SubAssembly"].ToString().Trim();
}
string q3 = "insert into failure_report(job_number, Asset_no, component_des, failure_symp, sub_assembly) VALUES ('" + jobnumber.Text.ToString().Trim() + "','" + AssetNumber.Text.ToString().Trim() + "','" + compdes.Text.ToString().Trim() + "', '" + selectedSymptom + "', '" + selectedSubAssembly + "' )";
[/code]
obislavu