Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BO.CreateParameter and null
Message
From
04/06/2010 21:33:29
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01465928
Message ID:
01467446
Views:
35
>>Hi,
>>
>>I am trying a new technique with stored procedures and I need to pass null values to them in order to make it work.
>>
>>However, now I am getting an error on this line of code (C#)
>>
>>
return this.GetEntity("ClientsSelectByDynamic",
>>this.CreateParameter("@ClientNumber", clientNumber),
>>this.CreateParameter("@ClientName", clientName),
>>this.CreateParameter("@PolicyNumber", policyNumber));
>>
>>The error I get is:
>>
>>System.Data.SqlClient.SqlException was unhandled by user code
>>Message="Procedure or function 'ClientsSelectByDynamic' expects parameter '@ClientName', which was not supplied."
>>
>>I am guessing CreateParameter does not handle null values. What can I do to get this to work?
>>
>>I am using VS2008 and MM.NET 3.6
>
>Frank,
>I use null values with CreateParameter routinely. Usually, the value I am passing in to the business object code is coming from a text box so I test the value using MMTYpe.IsEmpty(). If the value is null, I use this.CreateParameter("@ClientName", null).

Thanks, I'll revisit that and see if I can work out what was happening.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform