Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default SqlParameter Value To Null
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01381129
Message ID:
01381132
Vues:
29
>I have the following piece of code:
>
>
>SqlParameter PartDesc = new SqlParameter();
>PartDesc.SqlDbType = SqlDbType.VarChar;
>PartDesc.ParameterName = "@Part_Description";
>PartDesc.Value = txtPartDesc.Text;
>
>
>If the user didn't type anything into the txtPartDesc field, how would ensure that NULL was passed to the stored procedure?

Are you using ASP.NET or Windows Forms? I know that for ASP.NET you can specify special property on SQLDataSource parameter to convert empty string to NULL.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform