Wednesday, November 27, 2013

SQL Server Compact (UPDATING) records

I don't under stand this. It errors out every time I try and run my program. I get the error of.


There was an error parsing the query. { Token line number = 1,Token line offset = 59,Token in error =>]


and here's my method that I use to update the entry.



public void UpDatedEmail(SqlCeConnection cn, string uName, string uEmail)
{

cn.Open();

SqlCeCommand cm = new SqlCeCommand("UPDATE users SET email = @email WHERE username = @username)", cn);
cm.Parameters.AddWithValue("@username", uName);
cm.Parameters.AddWithValue("@email", uEmail);

try
{
cm.ExecuteNonQuery();

Door.WriteLn("Email Updated successfuly!");
Thread.Sleep(1000);
}
catch (Exception ee)
{
Door.WriteLn("Error : " + ee.Message);
Thread.Sleep(1000);
Door.WriteLn("Press Enter");
Door.ReadKey();
}
cn.Close();
}





Pro-Forums

Delta Force Barracks

On the Frontlines


No comments:

Post a Comment