Click here to Skip to main content
15,903,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
SqlCommand Command = new SqlCommand("insert into location values (@loc,@reg", _con);
            Command.Parameters.AddWithValue("@loc", txtloc.Text);
            Command.Parameters.AddWithValue("@reg", txtreg.Text);
            _con.Open();
            Command.ExecuteNonQuery();
            _con.Close();

i have location table and i'm inserting two values init
it shows that incorrect syntax near @reg

i can't find the mistake where i have done...........
thanks in advance..
Posted
Updated 29-Nov-14 2:01am
v2

1 solution

You have missed ')'

Systax Error :
SQL
insert into location values (@loc,@reg)
 
Share this answer
 
v3

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