I am unable to find the answer to this problem which have been bugging me for a long time.
When I try to insert into sql table, I use this insert method:
Dim datDOB as date
datDOB = RadDatePickerDOB.DbSelectedDate ---- since it is not a required field so it can be nothing
Dim cmdAddNewRecord as new sqlCommand("INSERT INTO [Table1] ([DOB]) " & _
"VALUES ('"& datDOB & "')", SqlConnection)
Dim daAddNewRecord As New SqlDataAdapter(cmdAddNewRecord)
Dim dsAddNewRecord As New DataSet
Try
If SqlConnection.State <> ConnectionState.Open Then
SqlConnection.Open()
End If
daAddNewRecord.Fill(dsAddNewRecord)
lblError.Visible = True
lblError.Text = "Data has been submitted successfully."
Catch ex As Exception
lblError.Text = ex.Message.ToString
Finally
If SqlConnection.State <> ConnectionState.Closed Then
SqlConnection.Close()
End If
End Try
It inserted successfully but it insert this date: 1/1/1900 12:00:00 AM which I do not want! I would like to insert nothing or null into the table.
Anybody has any idea?
Thank you.



<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> </Scripts></telerik:RadScriptManager>