09-07-19, 03:58 PM
PHP كود :
DataTable QDt = new DataTable();
QDt.Clear();
cmd = new SqlCommand("select Project_Name from PROJECTS where Project_Number like '*" + comboBox2.SelectedItem.ToString() + "*'", sqlcon);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(QDt);
if (QDt.Rows.Count > 0)
{
comboBox3.Items.Clear();
foreach (var str in QDt.Rows)
{
comboBox3.Items.Add(str);
}
// or
comboBox3.DataSource = QDt;
}