0

I have trying to insert Date from Vb.net to SQL Database But when i click insert Button then show me above error message.I need your help Thanks.

I have been trying for a long time to insert the data in many ways, but have been consistently failing.

My Code for insert Date is below.

cmd.Parameters.Add("@DtpDOB", SqlDbType.Date).Value = DtpDOB.Value
  • 1
    Whatever you are calling would seem to be expecting an integer. – Gordon Linoff Apr 08 '20 at 13:22
  • 2
    The actual query is missing, this piece of code simply generates a parameter. You need to show the `INSERT` query. Before you do, go to your database manager, check each and every Field's Data Type, post it here along with the query you're using to insert the data. Also specify the source of the data you're trying to insert and its type. BTW, if Field type where you're trying to insert a DateTime value is of type String, change it to DateTime before anything else. – Jimi Apr 08 '20 at 13:54
  • Ok i will post new with a source code and data type – Official BaRyaR Apr 08 '20 at 19:23
  • now i have new post with complete details please review my new post about it and give me solution i am thank full to you Jimi – Official BaRyaR Apr 08 '20 at 19:37
  • Does this answer your question? ['Failed to convert parameter value from a String to a Int32/](https://stackoverflow.com/questions/61108665/failed-to-convert-parameter-value-from-a-string-to-a-int32) – Caius Jard Apr 10 '20 at 05:54
  • By the way, stack overflow doesn't allow questions with the exact same title as another question because it is highly likely they are duplicates. Do not just add junk characters after the question title to defeat this mechanism- go read the original question and see if it answers your problem and if it does not, think more carefully about what your question title should be – Caius Jard Apr 10 '20 at 05:56

0 Answers0