conn=new SqlConnection("workstation id=ZERG1;packet size=4096;integrated security=SSPI;data source=ZERG1;persist security info=False;initial catalog=Northwind");
string sql="select * from biyesheji where changshang like '%"+textBox1.Text+"%' or wpid like '%"+textBox1.Text+"%' or wpiming like '%"+textBox1.Text+"%' or guige like '%"+textBox1.Text+"%'";
cmd=new SqlCommand(sql,conn);
SqlDataAdapter da=new SqlDataAdapter(cmd);
DataSet ds=new DataSet();
da.Fill(ds,"biyesheji");
dataGrid1.DataSource=ds;
dataGrid1.DataMember="biyesheji";
conn.Close();
实现WINFORM模糊查询
最新推荐文章于 2022-08-30 16:28:42 发布