ms access 2003 - Data type mismatch in criteria expression c# -


the following exception thrown when run below code:

system.data.oledb.oledbexception data type mismatch in criteria expression

private void buttonup_click(object sender, eventargs e) {     try     {         connection.open();         oledbcommand command = new oledbcommand();         command.connection = connection;         string query = "update data set  name ='"+txtnl.text+"' , period ='"+txtper.text+"' , dob = '"+txtmonth.text+"', price = '"+txtprice.text+"', follow = '"+combofw.text+"' id = "+txtid.text+" ";         //(id,name,period,dob,price,follow)         messagebox.show(query);         command.commandtext = query;          command.executenonquery();         messagebox.show("data edited/updated successful");         connection.close();     }     catch (exception ex)     { messagebox.show("error " + ex); } } 

how can fix this?

one of inputs not match data type database table expecting. example if pass"abbx" date text , table expecting datetime, it's not going work. make sure match types in input 1 table has.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -