strCmd.Format("delete FROM userTable where name = '%s'", name);

string.Format("select * from 数据库表 where 用户名='%s' and 密码='%s' ",m_1,m_2);

把【m_1】和【m_2】的值按照【%s】的格式传给字符串【select * from 数据库表 where 用户名='%s' and 密码='%s' 】。

比如:m_1=张三,m_2='abc' 那么出来的结果就是:
【select * from 数据库表 where 用户名='张三' and 密码='abc'】

猜你喜欢

转载自www.cnblogs.com/wjq13752525588/p/11459793.html