【发布时间】:2018-01-03 04:13:24
【问题描述】:
我有一个名为 sang.mdf 的数据库,它包含 slno、日期、名称、金额等字段。我想搜索在数据库名称字段中输入的数据。即,如果字段名称包含数据“Abijith”。然后我在我想从数据库中查看“Abijith”的文本框中搜索“Abi”。你能帮帮我吗..
sql connection con = new sqlconnection(@"connection string");
string abi = "select billno, date, name, total from sannew where name = '" + textBox3.Text + "'";
SqlDataAdapter sdaa = new SqlDataAdapter(abi, con);
DataSet dss = new DataSet();
sdaa.Fill(dss);
dataGridView1.DataSource = dss.Tables[0];
在这种方法中,我想输入全文“Abijith”进行搜索和查看。但是当我搜索“Abi”时,没有找到搜索项
【问题讨论】:
-
代码在哪里?您在使用代码时遇到什么问题?你知道如何使用 ADO.NET 类从数据库中查询数据吗?
-
我需要 c# Visual Studio Windows 窗体中的代码
-
sqlconnection con = new sqlconnection(@"connection string"); string abi = "select billno, date, name, total from sannew where name = '" + textBox3.Text + "'"; SqlDataAdapter sdaa = new SqlDataAdapter(abi, con);数据集 dss = new DataSet(); sdaa.填充(dss); dataGridView1.DataSource = dss.Tables[0]; -
为什么不把这段代码放在你的问题中?
标签: c# sql visual-studio search windows-forms-designer