views:

97

answers:

2

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 :

alt text

But when i click ok it returns following error:

alt text

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.

+1  A: 

After you create the page with the dialogue helpers, just switch to code view of your html and change them by hand on the created code...

Aristos
but the parameters are dynamically changed depending upon the selection made by the user so how to change them in html Can you kindly give some example.
Rahat Ali
@Rahat can you please type here the generated code to give you an example (if I can) on your code.
Aristos
<asp:SqlDataSource ID="SqlDataSourceLog" runat="server" ConnectionString="<%$ ConnectionStrings:SmokeDBConString %>" SelectCommand="qry_log" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter Name="MaxRecords" Type="Int32" /> <asp:Parameter Name="Level" Type="String" /> <asp:Parameter Name="FromDate" DbType="DateTime"/> <asp:Parameter Name="ToDate" DbType="DateTime"/> </SelectParameters> </asp:SqlDataSource>
Rahat Ali
A: 

I have resolved the problem by passing each level in single quotes without , after the last level as shown in the image below:

alt text

Anyway thanks for your help Aristos!

Rahat Ali
Ah ok, this is great.
Aristos