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
Renjith V S
NA
317
65.9k
How to insert only selected data to table?
Mar 25 2014 8:25 AM
Hi,
I have a table login in sql it contains lots of fields(for example fname,lname,Password,address,Username etc). I need to insert some data only to the table(Username and Password). I use the code in C#
SqlCommand cmd = new SqlCommand("insert into login values(@UserName)", con);
cmd.Parameters.AddWithValue("@UserName", txtUserName.Text);
cmd.Parameters.AddWithValue("@Password", txtPassword.Text);
on clicking submit button it shows an error message:
"Column name or number of supplied values does not match table definition"
Please correct the problem.
Reply
Answers (
3
)
Migration Data in .NET
How to show Binary image in Grid View in Asp.net