如果是类似"select * from user where uid="+uid +" and pwd="+pwd 很容易出问题
使用 SQLParamenter
把你的SQL语句写成 类似存储过程
select * from user where uid=@uid and pwd=@pwd
使用这个SQL语句定义为 SQLCommand 对象 然后使用 Paramenter 对象把 @*** 替换为 值
就可以搞定注入式漏洞了