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
navya b
NA
42
46.4k
err: column name or number of supplied values does not match
Jun 22 2015 2:25 AM
i was getting an error :Column name or number of supplied values does not match table definition.
Line 23: cmd.ExecuteNonQuery();
-------------------
this is my c# code
protected
void
Button1_Click(
object
sender,
EventArgs
e)
{
string
gend = RadioButtonList1.SelectedItem.ToString();
con.Open();
SqlCommand
cmd =
new
SqlCommand
(
"INSERT into OwnerReg VALUES('"
+ TextBox1.Text +
"',
'"
+ TextBox2.Text +
"', '"
+ TextBox7.Text +
"',
'"
+ gend +
"','"
+ TextBox3.Text +
"','"
+ TextBox4.Text +
"',
'"
+ TextBox5.Text +
"','"
+ TextBox6.Text +
"')"
, con);
cmd.ExecuteNonQuery();
con.Close();
Label16.Text =
"Registered Successfully...."
;
}
--------------------------------------------------------
Data base table: OwnerReg
Username nvarchar(50),Password nvarchar(50),ConfirmPassword nvarchar(50),Gender nvarchar(50),DOB nvarchar(50),
Email nvarchar(MAX),MobileNO nvarchar(50),Address nvarchar(MAX)
plz help me...
Reply
Answers (
5
)
I don't understand Reflection in C#
how to display same value in dropdownlist in edit mode of gr