Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BO.CreateParameter and null
Message
 
À
25/05/2010 14:21:21
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01465928
Message ID:
01467428
Vues:
29
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform