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
kritika
NA
53
0
problem in inserting data into database...!!!
Nov 4 2009 6:27 AM
hello....
as i had changed da code .....silly error is coming while inserting data into database....
here is my code ....
protected
void
btnregister_Click(
object
sender,
EventArgs
e)
{
if
(Page.IsValid ==
true
)
{
con.Open();
string
userstr=
"INSERT INTO User(Code,UserPass,FirstName,LastName,BDate,BMonth,BYear) VALUES('"
+ txtuserid.Text +
"','"
+ txtPassword.Text +
"','"
+ txtFirstName.Text +
"','"
+ txtLastName.Text +
"',
'"
+ ddlDay.SelectedItem.ToString() +
"','"
+ ddlMonth.SelectedItem.ToString() +
"','"
+ ddlYear.SelectedItem.ToString() +
"');"
;
cmd =
new
OleDbCommand
(userstr, con);
cmd.ExecuteNonQuery();
Response.Redirect(
"abc.aspx"
);
con.Close();
}
}
//here ddlDate,ddlMonth,ddlYear are 3 dropdownlist
it giving me error ..!!!
plz tell me where m going wrong?!
thanks in advance..
Reply
Answers (
7
)
Need Simple Progress Bar in asp.net
Stylish Tabs with Submenu