dear fellas,
usually i send string.empty to db of no data entered by user.
and it left empty data in my db.
but what can i do if i want to send null value instead of string.empty to my db if my data type is VARCHAR.
tq
You need to first make sure that your column field allows NULL, if it does then you can directly pass null value by checking as follows
string value = !string.IsNullOrEmpty(TextBox1.Text) ? TextBox1.Text : null;
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.