[英]Pass string parameter to SqlDataSource in asp.net
i have placed a SqlDataSource component on my aspx page but while configuring the SqlDataSource in the "Test Query" Step I am passing the following parameters : 我已经在aspx页面上放置了一个SqlDataSource组件,但是在“测试查询”步骤中配置SqlDataSource时,我传递了以下参数:
But when i click ok it returns following error: 但是,当我单击确定时,它将返回以下错误:
This error occurs when i pass the string : 当我传递字符串时,会发生此错误:
INFO, WARN, ERROR, 信息,警告,错误,
I have tried a lot of combinations but nothing works. 我尝试了很多组合,但是没有用。 It works only if i pass one of the three words in single quotes like this :
仅当我将三个单词之一用单引号引起来时,它才起作用:
'ERROR' '错误'
Infact the INFO WARN and ERROR are the various levels available in the table. 实际上,信息警告和错误是表中可用的各种级别。 Each record can have only one level and in the sql query i am using IN("-----") to match the criteria, hope you understand.
每个记录只能有一个级别,在sql查询中,我正在使用IN(“ -----”)来匹配条件,希望您理解。
Any idea to pass the string with comas between them will be highly appreciated. 任何在字符串之间使用逗号分隔的想法将受到高度赞赏。
使用对话助手创建页面后,只需切换到html的代码视图,然后手动在创建的代码上进行更改...
I have resolved the problem by passing each level in single quotes without , after the last level as shown in the image below: 我已经解决了这个问题,如下图所示,在最后一个级别之后,用不带的单引号将每个级别都传递了,而不是:
Anyway thanks for your help Aristos! 无论如何,感谢您对亚里士多德的帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.