我想让让DataGridView的选中的那一列,等于符合查询结果的一列。如何补全下列代码?
private void button4_Click(object sender, EventArgs e)
{
string names = textBox1.Text.ToString();
SqlConnection conn = new SqlConnection(conn_str);
string sel_str = "select * from cj_main where cj_names ='"+&names&+"' ";
SqlCommand cmd = new SqlCommand(sel_str, conn);
find_do = new SqlDataAdapter();
find_do.SelectCommand = cmd;
ds = new DataSet();
find_do.Fill(ds, "rs");
}
private void button4_Click(object sender, EventArgs e)
{
string names = textBox1.Text.ToString();
SqlConnection conn = new SqlConnection(conn_str);
string sel_str = "select * from cj_main where cj_names ='"+&names&+"' ";
SqlCommand cmd = new SqlCommand(sel_str, conn);
find_do = new SqlDataAdapter();
find_do.SelectCommand = cmd;
ds = new DataSet();
find_do.Fill(ds, "rs");
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货