I have a problem saving the system date.
In my table I have a column date (datetime)
But I get a "SQL datetime overflow" error in my project.
This is how I input my data
Dim today As System.DateTime
Dim cmdAddTransaction As New SqlCommand("INSERT INTO [Scanner].[dbo].[Transaction]([ID], [Name], [Description], [Date]) VALUES(@ID, @Name, @Description, @Date)", Connection)
cmdAddTransaction.CommandType = CommandType.Text
cmdAddTransaction.Parameters.AddWithValue("@ID", frm_main.txtbox_id.Text)
cmdAddTransaction.Parameters.AddWithValue("@Name", txtbox_Fname.Text)
cmdAddTransaction.Parameters.AddWithValue("@Description", "Edit Account")
cmdAddTransaction.Parameters.AddWithValue("@Date", today)
cmdAddTransaction.ExecuteNonQuery()
MsgBox("User Successfully Updated")
But as I said I get an error. Can please someone help me I want the date to be formatted like mmm/dd/yyyy
if its possible.