Click here to Skip to main content
15,942,710 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating a site with asp.net web-forms. I created a SQL Server compact 4.0 local database. While trying to insert data, i get an error for the last 3days and cant fixe it. Help!!! this error said:
" There was an error parsing the query. [ Token line number = 1,Token line offset = 48,Token in error = insert ] "

HERE IS MY LINES OF CODES:¨
"
INSERT INTO login
(username, password) 
Values ('kriss', 'aspnet');

"
Posted
Comments
Karthik_Mahalingam 19-Jan-14 1:36am    
can u post full code..
Kristian Lagaffe 19-Jan-14 1:51am    
i having done anything much. i just begin asp.net classed and this my first assignment i am working on. After i designed the graphical UI for login, i added a new item "SQL server compact 4.0 local database". I graphically created a table called login. Then i am tryin to insert these values in the tables with 3 columns(login_ID, username,password).
Karthik_Mahalingam 19-Jan-14 1:55am    
Login_ID is int autoincrement with seed (1,1) ????
Kristian Lagaffe 19-Jan-14 1:57am    
yes, exactely
Karthik_Mahalingam 19-Jan-14 1:59am    
can u pls post the schema of the table..
and also the c# code where your executing this ..

Hi Kristian,
Your solution is just change the name of password field, because password is reserved word in SQL... :-)

Like-:
SQL
INSERT INTO login
(username, pswd)
Values ('kriss', 'aspnet');
 
Share this answer
 
Actually the system doesn't seems to accept either "username" or "password" as field names. So i changed both. Thanks to JCahyaatnttearjee who's solution guided me.
Thanks to you all

SQL
INSERT INTO login
                         (login_username, login_pwsd)
VALUES        ('aspnet', 'site')
 
Share this answer
 
v2

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