简体   繁体   中英

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 :

替代文字

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM