Click here to Skip to main content
15,887,356 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
string str = "insert into contact(file_no, full_name, designation, department, company_name, contact_type, categories, street, city, pincode, assistant_name, ph_home, ph_mobile, ph_bus_office, ph_bus_res, fax, email_id, website) values(" + textBox17.Text + "'," + "'" + textBox1.Text + "'," + "'" + textBox2.Text + "'," + "'" + textBox3.Text +"'," + "'" + textBox4.Text + "'," + "'" + textBox5.Text + "'," + "'" + textBox6.Text + "'," + "'" + address + "'," + "'" + textBox9.Text + "'," + "'" + textBox10.Text +"'," + "'" + textBox13.Text + "'," + "'" + textBox19.Text + "'," + "'" + textBox20.Text + "'," + "'" + textBox21.Text + "'," + "'" + textBox22.Text + "'," + "'" + textBox23.Text +"'," + "'" + textBox14.Text + "'," + "'" + textBox15.Text + "')";

I am getting error as syntax is missing in query statement.
Please help me resolve this thing.
Posted
Updated 4-Aug-13 19:52pm
v2

You need a (') after your values:
C#
string str = "insert into contact(file_no, full_name, designation, department, company_name, contact_type, categories, street, city, pincode, assistant_name, ph_home, ph_mobile, ph_bus_office, ph_bus_res, fax, email_id, website) values('" + ... 
 
Share this answer
 
Comments
Maciej Los 5-Aug-13 2:52am    
Hawk eye ;)
+5!
Mehdi Gholam 5-Aug-13 10:20am    
Easy when there is syntax highlighting :)
Maciej Los 5-Aug-13 15:33pm    
;)
MS Access data can be read by using of access data repair tool

Read next solution http://www.access.repairtoolboxx.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900