当前位置:编程学习 > C#/ASP.NET >>

不是可识别的表提示选项。如果它要作为表值函数的参数,请确保您的数据库兼容模式设置为90

C#中,select字符串如下 "select patientno as 病历号,payment,balance," +
"sidno,cellphone,homephone,companyphone,firstphone,name," +
"doctor,discipline,thisdate,appointmentid from view_needpay"+
"where cast(balance as money)<0 or payment is null";

用此字符串操作数据库中的view_needpay视图,提示::"balance" 不是可识别的表提示选项。如果它要作为表值函数的参数,请确保您的数据库兼容模式设置为 90。

但是我把where cast(balance as money)<0 or payment is null这个限制条件删除,字符串变为"select patientno as 病历号,payment,balance," +
"sidno,cellphone,homephone,companyphone,firstphone,name," +
"doctor,discipline,thisdate,appointmentid from view_needpay";
C#程序就可以正常运行。

请教大侠,我该如何处理呀?程序不通,真的是急人。我的数据库是2005,我看了一下,也没有地方可以设置数据库模式呀。 --------------------编程问答-------------------- "where cast(balance as money)<0 or payment is null";

==》

"  where cast(balance as money)<0 or payment is null";

加空格 --------------------编程问答-------------------- 呵呵,郁闷,真的粗心少了个空格。谢谢你 --------------------编程问答--------------------
引用 2 楼 zhujiang2222 的回复:
呵呵,郁闷,真的粗心少了个空格。谢谢你

那你就结了这个帖呗。。。 --------------------编程问答-------------------- 支持下、、细心
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,