cannot pass null value for paramters to the report

Stimulsoft Reports.NET discussion
Post Reply
imax36581
Posts: 12
Joined: Sat Aug 29, 2009 6:22 am
Location: teh

cannot pass null value for paramters to the report

Post 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
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

cannot pass null value for paramters to the report

Post by Andrew »

Hello,

Please show us a code when Nulls are assigned.

Thank you.
imax36581
Posts: 12
Joined: Sat Aug 29, 2009 6:22 am
Location: teh

cannot pass null value for paramters to the report

Post 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();
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

cannot pass null value for paramters to the report

Post by Jan »

Hello,

Please try to specify instead null value DBNull.Value.

Thank you.
Post Reply