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
Carol Cashman
NA
74
11.6k
how to fix Server Error in '/' Application Error??
Jan 9 2018 11:40 AM
Hi guys,
i am trying to populate my database with detals i enter in my webform to save into the database but i receive this error :
Server Error in '/' Application.
Incorrect syntax near the keyword 'Order'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
This is my code:
protected void Button1_Click1(object sender, EventArgs e)
{
//Creating a connection to my database using the connection string
string cs = System.Configuration.ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(cs);
//preparing a query which will insert the data entered in the textboxes to the database
SqlCommand cmd = new SqlCommand("INSERT INTO Order(OrderDate, CustomerID, LidNo, StickerNo, LJarNo, SJarNo) values('" + this.txtDate.Text + "' ,'" + this.txtId.Text + "','" + this.txtLids.Text + "','" + this.txtStickers.Text + "','" + this.txtLargeJars.Text + "','" + this.txtSmallJars.Text + "')", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Response.Redirect("Orders.aspx");
}
and my database looks like this:
any help is greatly appriciated!
Reply
Answers (
12
)
how repeat specific tag with child after last tag XML
PropertyGrid control - cut the text and display three dots