Data type mismatch in criteria expression error in C# trying to insert data in Microsoft Access using ASP.net -


private oledbconnection bookconn; private oledbcommand oledbcmd = null; private string connparam; protected void page_load(object sender, eventargs e) {  } protected void btnsubmitform_click(object sender, eventargs e) {      if (page.isvalid)     {          connparam = @"provider=microsoft.ace.oledb.12.0;data source=" + server.mappath("validation.accdb") + ";persist security info=false;";         bookconn = new oledbconnection(connparam);         bookconn.open();          oledbcmd = new oledbcommand("insert tblclients(firstname,lastname, phone, streetaddress, city, zipcode) values('" + fname.text + "','" + lname.text + "'," + convert.toint64(phone.text) + ",'" + address.text + "','"+ city.text + "', " + convert.toint32(zipcode.text) + ")", bookconn);         oledbcmd.executenonquery();          bookconn.close();         response.redirect(httpcontext.current.request.path);     } } 

all know problem in insert into command.
firstname,lastname ,streetaddress,city strings , phone & zipcode integers. i'm not sure how fix error :/


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -