本文介绍了如何使用下拉列表检索数据库中的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
private void frmsupplier_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dbAutorecDataSet.supplier' table. You can move, or remove it, as needed.
this.supplierTableAdapter.Fill(this.dbAutorecDataSet.supplier);
SqlDataAdapter da = new SqlDataAdapter("select * from supplier", con);
DataSet ds = new DataSet();
da.Fill(ds, "supplier");
DataView dv = new DataView(ds.Tables["supplier"]);
da.Fill(dtspp);
showCurrentRecord();
SqlCommand cmd=new SqlCommand("select * from supplier where suppId='" + comboBox1.SelectedValue.ToString() + "'", con);
}
推荐答案
protected void comboBox1_IndexChanged(object sender, EventArgs e)
{
SqlCommand cmd=new SqlCommand("select * from supplier where suppId='" + comboBox1.SelectedValue.ToString() + "'", con);
//then all the sql command, retreival comes here
这篇关于如何使用下拉列表检索数据库中的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!