110,538
社区成员
发帖
与我相关
我的任务
分享
//查询按钮click事件
//连接数据库
……
string sqlstr="select "+combobox1.text+" from tableName where……";
SqlDataAdapter da = new SqlDataAdapter(sqlstr, conn);
DataSet ds = new DataSet();
da.Fill(ds);
this.GridView1.DataSource = ds.Tables[0].DefaultView;
this.GridView1.DataBind();