过滤gridview数据 [英] filter gridview data
本文介绍了过滤gridview数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在这里我创建了一个过滤数据的函数,但是这里的问题是当我按''
时出现了错误
这是我的代码
here i create a function to filter out the data but the problem here is it gave error when i press ''
here is my code
string clk = textBox1.Text;
querry = "SELECT userid_vc, username_vc FROM [GCERP_SEC].[dbo].[sec_users] where userid_vc like '" + clk + "%'";
FillData(querry);
推荐答案
请改用此.
Use this instead.
string clk = textBox1.Text.Replace("'","''");
>
只是一个建议:您应该改用参数化查询或存储过程.
Just a suggestion: You should use parameterized query or stored procedure instead.
这篇关于过滤gridview数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文