哪位大神能帮我看下代码哪里错了吗?

Death_wuying Death_wuying 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
private void button3_Click(object sender, EventArgs e)
{
serach();
}
public void serach()
{
// sqlInit();
// Database conn = new Database();
connection = new OleDbConnection(ConnStr);
connection.Open();
string s = textBoxSelectName.Text;
string selectStudentInfo = "SELECT * FROM [Student] WHERE [姓名]='"+ textBoxSelectName +"'";
OleDbDataAdapter Adap = new OleDbDataAdapter(selectStudentInfo, connection);
DataSet data = new DataSet();
Adap.Fill(data,"Student");
DataSet ds = data;
dataGridViewSelectStudentManage.DataSource = ds.Tables["Student"];
connection.Close();

}
数据库的链接,添加都实现了,就是这个查询实现不了,输入名字的话,不出来结果,只出来一行空白。听说CSDN上的大神很多,特来求教!
...全文
评论 16
收藏 已收藏
分享
返回顶部
Death_wuying
C# 111,129 成员 642,540 内容