Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sql777
Constraint Violating Yak Guru
314 Posts |
Posted - 2008-07-22 : 15:36:26
|
| Hi,I basically took the sproc code and put it inside a string, and I am calling the sql now from ADO.NET and not from a sproc now (because I have to be able to do dynamic order by's and ASC/DESC and I can't do that in a sproc w/o doing IF's etc).In my sproc, I did this in the beginning:@categoryid INT = NULL,@userID INT = NULLNow in my sql that I'm calling directly from ADO.NET, I can't set defaults like this now can I?What should I do because when I pass NULL for categoryid it says 'it expects parameter @categoryid which was not supplied'. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2008-07-22 : 15:55:34
|
| In your .NET code, how about passing DBNull.Value rather than the keyword NULL?---------------------------EmeraldCityDomains.com |
 |
|
|
|
|
|