Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
7
Reply
Updating SQL from C#, changing all the data
Benjamin Ashton
Jul 12 2012 2:23 PM
2.5k
Reply
I am using the below code to try and update records within my SQL server but having problems, it is updating all the records to what I want it to change too. It would be great if someone could steer me in the right direction.
da.UpdateCommand = new SqlCommand("UPDATE userInfo SET Username = @USERNAME, Password = @PASSWORD", cs);
da.UpdateCommand.Parameters.Add("@USERNAME", SqlDbType.VarChar).Value = txtUsername.Text;
da.UpdateCommand.Parameters.Add("@PASSWORD", SqlDbType.VarChar).Value = txtPassword.Text;
cs.Open();
da.UpdateCommand.ExecuteNonQuery();
cs.Close();
dgUpdate();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
how can I restrict keyboard key from overriding the application state
Read the word in pdf file