c#中,把查找出来的字段显示在webBrowser控件上,语句怎么写? 20
我的代码:stringstr=textBox1.Text.Trim();str=str.TrimEnd();//去掉后面的空格str=str.TrimStart();//...
我的代码:
string str = textBox1.Text.Trim();
str = str.TrimEnd(); // 去掉后面的空格
str = str.TrimStart(); //去掉前面的空格
str = "%" + str + "%"; //在后加上通配符
//sqlConnection1.Open();
string sql = "select words as 英文,meaning as 中文 ,lx as 例句 from cetsix where meaning like '" + str + "'";
if (textBox1.Text.Trim() == "" || rxx.IsMatch(textBox1.Text))
{
MessageBox.Show("请输英文或汉字!", "警告");
return;
}
else //if (textBox1.Text.Trim() != "")
//sql = sql+"words= "+""+textBox1.Text.Trim()+"";
sql = sql;
//sqlConnection1.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(sql, sqlConnection1);
DataSet ds = new DataSet();
ds.Clear();
adp.Fill(ds, "cetsix"); //sql语句报错
//dataGridView1.DataSource = ds.Tables[0].DefaultView;-----我需要把这个dataGridView1控件改成用webBrowser控件 展开
string str = textBox1.Text.Trim();
str = str.TrimEnd(); // 去掉后面的空格
str = str.TrimStart(); //去掉前面的空格
str = "%" + str + "%"; //在后加上通配符
//sqlConnection1.Open();
string sql = "select words as 英文,meaning as 中文 ,lx as 例句 from cetsix where meaning like '" + str + "'";
if (textBox1.Text.Trim() == "" || rxx.IsMatch(textBox1.Text))
{
MessageBox.Show("请输英文或汉字!", "警告");
return;
}
else //if (textBox1.Text.Trim() != "")
//sql = sql+"words= "+""+textBox1.Text.Trim()+"";
sql = sql;
//sqlConnection1.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(sql, sqlConnection1);
DataSet ds = new DataSet();
ds.Clear();
adp.Fill(ds, "cetsix"); //sql语句报错
//dataGridView1.DataSource = ds.Tables[0].DefaultView;-----我需要把这个dataGridView1控件改成用webBrowser控件 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询