主题:数据查询问题
string s1;
s1="select 图书编号,书名,作者,价格,书架号 from books";
if(this.radioButton1.Checked)
s1+="where 图书编号='"+textBox1.Text+"'";
this.oleDbDataAdapter1.SelectCommand.CommandText=s1;
this.dataSet11.Clear();
this.oleDbDataAdapter1.Fill(this.dataSet11);//显示出错//
this.dataGrid1.DataSource=this.dataSet11.Tables[0];
我想查询后在datagrid控件上显示出查询结果,this.oleDbDataAdapter1.Fill(this.dataSet11);出错,如何改才对?
s1="select 图书编号,书名,作者,价格,书架号 from books";
if(this.radioButton1.Checked)
s1+="where 图书编号='"+textBox1.Text+"'";
this.oleDbDataAdapter1.SelectCommand.CommandText=s1;
this.dataSet11.Clear();
this.oleDbDataAdapter1.Fill(this.dataSet11);//显示出错//
this.dataGrid1.DataSource=this.dataSet11.Tables[0];
我想查询后在datagrid控件上显示出查询结果,this.oleDbDataAdapter1.Fill(this.dataSet11);出错,如何改才对?