I have one text box for accepting date. I want to store date column in database is null when the text box value is null and how to bind the this null value to text box when i retrieve.
This way
object date = txtDate.Text == "" ? System.Data.SqlTypes.SqlDateTime.Null : Convert.ToDateTime(txtDate.Text); cmd.Parameters.AddWithValue("@Date", date);
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.