Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default SqlParameter Value To Null
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01381129
Message ID:
01381132
Views:
30
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform