0

Please folks I nid ur help, I av a data mismatch error in criteria expression. I av a variable of data type string which I added to my OleDbcommand object the code is below:
I used 2 textbox for surname and fname
I av a textbox I used for calculation in which d value is passed into a variable of type string.

Dim E, I As String

Dim command As OleDbcommand = New OleDbcommand ("INSERT INTO table (fname, expiry, initiald, surname) VALUES (?, ?, ?, ?)",conn)

Command.Parameters.Add("@fname", OleDbType.VarChar, 255).Value= txtfname.Text

Command.Parameters.Add("@surname", OleDbType.VarChar, 255).Value= txtsurname.Text

Command.Parameters.Add("@expiry", OleDbType.VarChar, 255).Value= E.ToString

Command.Parameters.Add("@initiald", OleDbType.VarChar, 255).Value= I.ToString

Before I included dis variables d query was working fine bt now I av data mismatch I don't know wht d problem is?

2
Contributors
1
Reply
4
Views
4 Years
Discussion Span
Last Post by Reverend Jim
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.