>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).
Linda Harmes
HiBit Technologies, Inc.