TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ajith s
NA
9
8.2k
regarding updating the table in Asp.net
Dec 5 2012 11:12 PM
Hi
I have created a simple application using two text boxes,one is for the username and other is for the password.And i have a button to submit
I have created the table with two columns (i.e)users,pass in sql server
In my application when i enter details in the text boxes i get an error at the run time in the browser (ie)'xxx' is not a column name....
here is the code below
protected void upd_Click(object sender, EventArgs e)
{
SqlConnection cn = new SqlConnection(@"Put the Connection String");
cn.Open();
SqlCommand cmd = new SqlCommand("UPDATE aa SET pass ='" +TextBox2.Text.Trim() + "', WHERE users=" + TextBox1.Text.Trim() + "", cn);
cmd.ExecuteNonQuery();
cn.Close();
load();
}
I was not able to update the fields in the table,when i give the username and password......
but when i give the column name as the username in the textbox1 the password gets updated in the entire column
Reply
Answers (
3
)
profile page creation
Strongly-Type View and Model