多部分标识符“ticket.ticketid”无法受约束。 [英] The multi-part identifier "ticket.ticketid" could not be bound.
问题描述
大家好..
我是学生,我正在学习如何使用vb创建表单但我被困在这里,因为这是我的学校项目,我需要有人帮我搞清楚我的代码有什么问题。我尝试在sql 2005中创建存储过程并且它给我这个错误消息245,级别16,状态1,行2
转换varchar值时转换失败' '@ Itinerary.ticketid''数据类型为int(但我的ticketid值已经整数而不是varchar)。请帮我 !感谢您花时间阅读我的按摩。
这是形式VB
请删除sql语句末尾的单引号参数。
单引号定义为字符串值(而不再作为参数) ),所以你的参数将被忽略
因此错误
SQL的结尾应该是这样的
展开 | 选择 | Wrap | 行号
感谢您的回复。
我删除了引号但它给了我其他错误
展开 | 选择 | Wrap | 行号
为什么你的参数名为@ Itinerary.ticketid?
我不知道是否a。参数名称中的(点)将是问题。
你试过给参数一个没有点的名字吗?
可能像@ItineraryTicketid那样吗?
hi everyone ..
I am a student and i am learning how to create form using vb but i am stuck here since this is my school project, I need someone to help me to figgure out what is wrong with my code.also i try to create store procedure in sql 2005 and it give me This error Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the varchar value ''@Itinerary.ticketid'' to data type int(but my ticketid value already integer not varchar). Please help me ! And Thank you for taking time to read my massage.
this is in form VB
Expand|Select|Wrap|Line Numbers解决方案hi,
Please remove the single quotes at the end of your sql Statement for the parameter.
Putting single quotes defines that as a string value (and not as a parameter anymore), so your parameter will be ignored
And hence the error
the end of the SQL should look like this
Expand|Select|Wrap|Line Numbers
Thank you for replying.
I remove the quotes but it give me other error
Expand|Select|Wrap|Line Numbers
why is your parameter named "@Itinerary.ticketid"?
I dont know if a . (dot) in the parameter name will be the issue.
Have you tried giving the parameter a name without the dot in it?
maybe soemthing like @ItineraryTicketid ?
这篇关于多部分标识符“ticket.ticketid”无法受约束。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆