insert into tblTotal(Id,User_Name,Company_Name,Product_Name,MRP,Salon_Cost,Qty,Total_Cost)values('1','Charu','hhwq','gfh','343','65','3','3546')
it can be working...
string sql = "INSERT INTO tblTotal (Id,User_Name,Company_Name,Product_Name,MRP,Salon_Cost,Qty,Total_Cost) VALUES (@Id,@User_Name,@Company_Name,@Product_Name,@MRP,@Salon_Cost,@Qty,@Total_Cost)";
SqlCommand cmd = new SqlCommand(sql, con);
{
con.Open();
cmd.Parameters.AddWithValue("@Id", lblGrandTotal.Text);
cmd.Parameters.AddWithValue("@User_Name", lbUserName.Text);
cmd.Parameters.AddWithValue("@Company_Name", Wella.Text);
cmd.Parameters.AddWithValue("@Product_Name", g1.Cells[0].Text);
cmd.Parameters.AddWithValue("@MRP", g1.Cells[1].Text);
cmd.Parameters.AddWithValue("@Salon_Cost", g1.Cells[2].Text);
cmd.Parameters.AddWithValue("@Qty", Qty.Text);
cmd.Parameters.AddWithValue("@Total_Cost", Total_Cost.Text);
cmd.ExecuteNonQuery();
con.Close();
this code is some kind of error..