Last post Jun 02, 2011 02:45 AM by xeonix_
Jun 01, 2011 12:54 PM|xeonix_|LINK
Hi guys! Have question bout DAAB:
I have stored procedure in my database which accepts optional parameters like:
create procedure MyProc @SomeParam int = 1 as begin
return N'return some stuff';
I did not find any way to specify, that parameter is optional.
I tried to omit parameter, when getting "DbCommand", but got exception when tried to execute it.
So is there any way to tell "DbCommand" that my parameter is optional?
Jun 01, 2011 11:14 PM|suresh_g_v2002|LINK
I guess...you can only send null values to optional parameters in stored procedures.., in your case int cant expect a null value so..,
so use nullabe int value.., from the .Net code..,
When u assing null values it takes the default value as mentioned in the stored proc..
Jun 02, 2011 02:45 AM|xeonix_|LINK
Yes, I can. But in this case parameter would be exactly NULL, but I need it to accept its default value. It seems like there's no way for that, so I'll just keep using old good ADO.NET.