string sql="select a.name,a.email,a.telephone,a.discountid,b.discountname a.memo from passenger a,discount b where a.discountid=b.discountid and a.personcard="+Txtpercard.Text.ToString();好像有错!不能这样写
解决方案 »
- 怎样创建快捷方式
- checklistbox中如何找到失去焦点的那一个选择栏
- 求助(帮我看看这段代码)??????
- 为什么Tdll.dll只能放在系统目录下,如果我放在Bin目录下应该怎么写(也不能写绝对路径!)
- 如何在winform中将dataset中的内容导成xml
- C#编程封局域网中其它计算机IP地址或端口号
- 有问题请教:安装visual stdio.net出现了问题....请求帮助,小女子不胜感激~~
- 关于插件的问题,请高手指教
- 各位DX,我用用DataSet进行数据更新时发生错误,提示“insert into 语句的语法错误”?
- MessageBox中显示是否退出,出现问题,求指点!
- 关于中文编解码(含源代码)
- 怎么知道共查找了几条记录了?
string sql="select a.name,a.email,a.telephone,a.discountid,b.discountname,a.memo from passenger a,discount b where a.discountid=b.discountid and a.personcard="+Txtpercard.Text.ToString();
sql="select a.name,a.email,a.telephone,a.discountid,b.discountname,a.memo from passenger a,discount b where a.discountid=b.discountid and a.personcard='"+Txtpercard.Text.ToString()+"'";
在最后面的Txtpercard.Text.ToString()错了,string类型要在sql语句中加上单引号另外,你的这个语句中(我指的是C#),不需要在Txtpercard.Text后面加上ToString(),因为那个已经是string了