G
Guest
Hi,
I am writing a subscription page in C#. I first check if username is unique by
"SELECT UserName FROM Logins WHERE Username ='dadada'"
Then if unique, I create the user by
"INSERT INTO Logins
(UserName,UserType,Password,StartDate,Status,Email,Phone,Home) VALUES
('dadada','u','dadadada',#8/25/2005 5:22:33
PM#,'trial','(e-mail address removed)','1231231231','10 brechk st., bridgewater, nj
08807')"
Somehow this always returns exception after running dbCmd.ExecuteNonQuery()
as below
"Syntax error in INSERT INTO statement."
I checked the syntax many times, could not find anything wrong.
When user logins in, I update the DB successfully as below:
"INSERT INTO Visits (Email,LoginDate,ReferPage,LoginOK,LoginPass,IP) VALUES
('admina',#8/25/2005 5:25:16
PM#,'/passwordProtectCSharp/privatePage.aspx',1,'adminabc','127.0.0.1')"
So access to DB is OK. I suspect my first reading to Logins table caused ldb
lock. So I can not insert afterwards. After removing the check of uniqueness,
I still have the same error.
Any suggestions? Thanks. -Dale
PS. ldb file sometimes stays there for a long time, sometimes it disappears
soon after code is stopped. can not delete it. any way to control it?
I am writing a subscription page in C#. I first check if username is unique by
"SELECT UserName FROM Logins WHERE Username ='dadada'"
Then if unique, I create the user by
"INSERT INTO Logins
(UserName,UserType,Password,StartDate,Status,Email,Phone,Home) VALUES
('dadada','u','dadadada',#8/25/2005 5:22:33
PM#,'trial','(e-mail address removed)','1231231231','10 brechk st., bridgewater, nj
08807')"
Somehow this always returns exception after running dbCmd.ExecuteNonQuery()
as below
"Syntax error in INSERT INTO statement."
I checked the syntax many times, could not find anything wrong.
When user logins in, I update the DB successfully as below:
"INSERT INTO Visits (Email,LoginDate,ReferPage,LoginOK,LoginPass,IP) VALUES
('admina',#8/25/2005 5:25:16
PM#,'/passwordProtectCSharp/privatePage.aspx',1,'adminabc','127.0.0.1')"
So access to DB is OK. I suspect my first reading to Logins table caused ldb
lock. So I can not insert afterwards. After removing the check of uniqueness,
I still have the same error.
Any suggestions? Thanks. -Dale
PS. ldb file sometimes stays there for a long time, sometimes it disappears
soon after code is stopped. can not delete it. any way to control it?