I have one porject in VB.NET with Ms Access As Backend...While inserting data into table there is no error at query and Data Type Error,but sometime OleDB Exception occurs Error is"Data type mismatch in criteria expression." the query is ....
Dim cmdstr1 As String = ""
Dim constr As String = ""
Dim sqlQuery As String = ""
constr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\PhoneDiary\MyDiary.mdb"
cmdstr = "Insert Into [DetailData]([ShortName],[Title],[FirstName],[MiddleName],[LastName],[Occupation],[DOB],[Gender],[Country],[State],[Address],[ZipCode],[City],[Memo],[CategoryId],[SubCategoryId],[FavouritesID],[PhotoPath],[vCardPath]) VALUES(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq,rr,ss)"
con = New OleDbConnection(constr)
com = New OleDbCommand(cmdstr, con)
con.Open()
com.Parameters.AddWithValue("aa", xx)
com.Parameters.AddWithValue("bb", cmbTitle.Text)
com.Parameters.AddWithValue.....
com.Parameters.AddWithValue....
.....................
......
com.ExecuteNonQuery()-------"Data type mismatch in criteria expression" Here occurs Error
So can u or anybody help me to solve this Problem,please