C#和VB中的ASP.NET中的差异 [英] diffrence in asp.net in c# and vb

查看:59
本文介绍了C#和VB中的ASP.NET中的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

objCmd.CommandType = CommandType.Text
objCmd.CommandText = "{{CALL amits.tst2 (? ?)}}"
Execute iSeries non-stored procedure program call
objCmd.ExecuteNonQuery()



对于上面的vb代码可以正常工作
但由于C#无法正常工作,请建议



for above vb code is working fine
but for c# is not working please suggest

cmd.CommandType = CommandType.Text;
cmd.CommandText = "CALL AMITS.TST2()";
cmd.ExecuteNonQuery();



它给出了错误......

SQL0104:令牌?无效.有效令牌:),.原因 . . . . . :在令牌?处检测到语法错误.令牌?不是有效的令牌.有效令牌的部分列表是),.该列表假定该语句在令牌之前是正确的.该错误可能早于该语句,但是该语句的语法到目前为止一直有效.恢复 . . . :请执行以下一项或多项操作,然后重试该请求:-验证令牌区域中的SQL语句?更正该语句.该错误可能是缺少逗号或引号,可能是拼写错误的单词,或者可能与子句的顺序有关. -如果错误令牌是< state-of-statement> ;,请更正该SQL语句,因为它没有以有效的子句结尾.



it given error ......

SQL0104: Token ? was not valid. Valid tokens: ) ,. Cause . . . . . : A syntax error was detected at token ?. Token ? is not a valid token. A partial list of valid tokens is ) ,. This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token ?. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is <end-of-statement>, correct the SQL statement because it does not end with a valid clause.

推荐答案

(?)表示SQL需要查询中的参数.

vb.net和c#之间没有区别,取决于您喜欢或使用哪种语言. C#适用于具有Java,C ++,Pascal经验的develeloper. VB.NET是Basic :)

因此,希望对您有所帮助:)
(?) means that the SQL expects a parameter in the query.

There aren´t differences between vb.net and c# depends on What language do you like or use. C# is for develeloper that have some experience with java, c++, pascal. VB.NET is Basic :)

So, hope it helps :)


这篇关于C#和VB中的ASP.NET中的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆