Page 1 of 1

cannot pass null value for paramters to the report

Posted: Tue Mar 16, 2010 2:08 pm
by imax36581
hi im using Stimulsoft 2009 and i add a query in my report
when i send my parameters value to my report from C# it give me a error when i want to send NULL value to my parameters.the error says the parameters not specified.
my query is something like this:
SELECT column1
FROM table1
WHERE column1 = ISNULL(@param1, column1)
AND column2 = ISNULL(@param2, column2)
when i specify a null for @param2 the error comes up and incidate that parameter not specified!
Thanks in Advance

cannot pass null value for paramters to the report

Posted: Wed Mar 17, 2010 1:11 am
by Andrew
Hello,

Please show us a code when Nulls are assigned.

Thank you.

cannot pass null value for paramters to the report

Posted: Wed Mar 17, 2010 8:35 am
by imax36581
Andrew wrote:Hello,

Please show us a code when Nulls are assigned.

Thank you.
something like this:

string mystr;
if (checkbox1.Checked=True)
mystr=null;
else
mystr=txt_name.Text;
report.Compile();
report["@param1"] = txt_lname.Text;
report["@param2"] = mystr;
report.show();

cannot pass null value for paramters to the report

Posted: Thu Mar 18, 2010 1:57 am
by Jan
Hello,

Please try to specify instead null value DBNull.Value.

Thank you.