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
Sourabh Dhiman
NA
2
709
Plzz Solve In this code error
Aug 17 2018 2:57 AM
SqlCommand cmd = new SqlCommand("insert into tblProduct(ProductID,Name,UnitPrice,QtyAvl)Values(@ProductID,@Name,@UnitPrice,@QtyAvl)", con);
cmd.Connection = con;
cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = TextBox1.Text;
cmd.Parameters.Add("@Name", SqlDbType.VarChar, 50).Value = TextBox2.Text;
cmd.Parameters.Add("@UnitPrice", SqlDbType.NVarChar, 50).Value = TextBox3.Text;
cmd.Parameters.Add("@QtyAvl", SqlDbType.NVarChar, 50).Value = TextBox4.Text;
cmd.ExecuteNonQuery();
SqlDataAdapter ds = new SqlDataAdapter();
DataTable dt = new DataTable();
ds.Fill(dt);
GridView2.DataSource = dt;
GridView2.DataBind();
cmd.Dispose();
con.Close();
what's error in code
Reply
Answers (
6
)
Javascript Issue
how to pass more than one parameter in web api