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:
01381142
Vues:
31
Read http://msdn.microsoft.com/en-us/library/ms172138.aspx

I see that you need to explicitly assign corresponding NULL value to a parameter using the proper type.

>WinForms
>
>
>>>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
Répondre
Fil
Voir

Click here to load this message in the networking platform