将登陆界面控件的值Login1.username付给查询语句 将登陆界面控件的值Login1.username付给查询语句,但是出错了。string strcommand="select * from t1 where name_id = 'Login1.username'"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string strcommand="select * from t1 where name_id = "+Login1.username; 不行啊,用textbox1.text 也不行string strcommand="select * from t1 where name_id = "+textbox1.text ;这样也不行啊!!string strcommand="select * from t1 where name_id = 'textbox1.text'" ; string strcommand="select * from t1 where name_id = '"+textbox1.text+"'" ;到底是不是你的SQL语句的问题哦。 直接赋值可以:string strcommand="select * from t1 where name_id = ‘aa’“ ;这样不行string strcommand="select * from t1 where name_id = "+textbox1.text ; 我想问一下,你的登陆界面是用什么软件开发的,是Microsoft Visual Studio 弄的吗??? '"+text1.text+"''+text1.text+'"+text1.text+"都不行啊,是格式的问题哦,到底应该怎么写哦。 string strcommand="select * from t1 where name_id = '"+textbox1.text +"'"; string strcommand="select * from t1 where name_id = '{0}'";strcommand=string.Format(strcommand,textbox1.text); string strcommand="select * from t1 where name_id = '{0}'";strcommand=string.Format(strcommand,textbox1.text);这个行!! string strcommand="select * from t1 where name_id = '{0}'";strcommand=string.Format(strcommand,textbox1.text);我想问下{0}代表啥意思?? C#问题 求一正则表达式删除空格 请问c++中指向结构的指针在c#中怎么表示啊? visual studio team foundation server 怎么理解这个东西 分页存储过程 返回记录总数问题.... 项目级提示的错误原因在哪里? 自动生成ASP.NET网页的问题? 简单问题,up也有分! C# webBrowser1 模拟控制select控件 C#如何获得DATAGRID模板列里的TEXTBOX呢 SQL Server 数据库怎么批量添加? 为什么有的时候点击一个按钮控件后,页面里的字会变大
string strcommand="select * from t1 where name_id = "+textbox1.text ;这样也不行啊!!
string strcommand="select * from t1 where name_id = 'textbox1.text'" ;
到底是不是你的SQL语句的问题哦。
string strcommand="select * from t1 where name_id = ‘aa’“ ;
这样不行
string strcommand="select * from t1 where name_id = "+textbox1.text ;
'+text1.text+'
"+text1.text+"
都不行啊,是格式的问题哦,到底应该怎么写哦。
strcommand=string.Format(strcommand,textbox1.text);
strcommand=string.Format(strcommand,textbox1.text);
这个行!!
strcommand=string.Format(strcommand,textbox1.text);
我想问下{0}代表啥意思??