Hi Pal,
I have issues with inserting date into my database. Though i declare the datatype as datetime in my SQL server database I will sincerely appreciate someones assistance in helping me fix the error. the error message is " Conversion failed when converting datetime from character string "
here is my code line:
Dim sqlcommand As New SqlCommand
With sqlcommand
.CommandText = "INSERT Into Secure_ProManagement Values('" & Me.CNameBox.Text & "','" & ClientShrtCode.Text & "','" & RMName.Text & "','" & RMContact.Text & "'," & RMNumber.Text & ",'" & StepsTxtBox.Text & "','" & EscalationTxtBox.Text & "','" & ProName.Text & "',' @d ',' @s ','" & Descriptn.Text & "')"
sqlcommand.Parameters.Add("@d", SqlDbType.DateTime).Value = CDate(EndDate.Text)
sqlcommand.Parameters.Add("@s", SqlDbType.DateTime).Value = CDate(StartDate.Text)
.Connection = connection
.ExecuteNonQuery()
End With