This is my insert statement. Records are not inserting but no errors showing also. Please help
protected void btn_Add_Click(object sender, EventArgs e)
{
if (btn_Add.Text == "Submit")
{
string Height = txtHeight.Text;
string TopDia = Convert.ToString(txtTopDiaMeter.Text);
string BottomDia = Convert.ToString(txtBottomDiaMeter.Text);
string ShaftThick = Convert.ToString(txtShaftThick.Text);
string BlackWt = Convert.ToString(txtBlackWeight.Text);
string TotManHrPerPole = Convert.ToString(txtTotManHrPoleData.Text);
string Plate_Length = Convert.ToString(txtPlateLength.Text);
string PLATE_DIA = Convert.ToString(txtPlateDia.Text);
string PLATE_THICKNESS = Convert.ToString(txtPlateThick.Text);
System.Collections.Hashtable ht = (System.Collections.Hashtable)Session["UserDetails"];
Int64 UsrId = (Int64)ht["UserID"];
string CreatedBy = Convert.ToString(UsrId);
string FoundBoltId = Convert.ToString(ddlFoundationBolt.SelectedValue);
string PoleTypeId = Convert.ToString(ddlPoltype.SelectedValue);
string ProductTypeID = Convert.ToString(ddlPdtType.SelectedValue);
string Status = chkActive.Checked ? "True" : "False";
string filename = Path.GetFileName(fileuploadimages.PostedFile.FileName);
fileuploadimages.SaveAs(Server.MapPath("~/Images/Pole Data/" + filename));
try
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["valmont"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand("Insert into DEF_POLE_DATA_MST(Height,TopDia,BottomDia,ShaftThick,BlackWt,TotManHrPerPole,Plate_Length,PLATE_DIA,PLATE_THICKNESS,CreatedBy,FoundBoltId,PoleTypeID,ProductTypeID,Status,ImagePath) values(@Height,@TopDia,@BottomDia,@ShaftThick,@BlackWt,@TotManHrPerPole,@Plate_Length,@PLATE_DIA,@PLATE_THICKNESS,@CreatedBy,@FoundBoltId,@PoleTypeId,@ProductTypeID,@Status,@ImagePath)", con);
cmd.Parameters.AddWithValue("@Height", Height);
cmd.Parameters.AddWithValue("@TopDia", TopDia);
cmd.Parameters.AddWithValue("@BottomDia", BottomDia);
cmd.Parameters.AddWithValue("@ShaftThick", ShaftThick);
cmd.Parameters.AddWithValue("@BlackWt", BlackWt);
cmd.Parameters.AddWithValue("@TotManHrPerPole", TotManHrPerPole);
cmd.Parameters.AddWithValue("@Plate_Length", Plate_Length);
cmd.Parameters.AddWithValue("@PLATE_DIA", PLATE_DIA);
cmd.Parameters.AddWithValue("@PLATE_THICKNESS", PLATE_THICKNESS);
cmd.Parameters.AddWithValue("@CreatedBy", CreatedBy);
cmd.Parameters.AddWithValue("@FoundBoltId", FoundBoltId);
cmd.Parameters.AddWithValue("@PoleTypeId", PoleTypeId);
cmd.Parameters.AddWithValue("@ProductTypeID", ProductTypeID);
cmd.Parameters.AddWithValue("@Status", Status);
cmd.Parameters.AddWithValue("@ImagePath", "~/Images/Pole Data/" + filename);
cmd.ExecuteNonQuery();
con.Close();
BindGrid();
Accordian.SelectedIndex = 1;
JQUERYDisplay.ShowAlertMessage("Record Inserted Successfully");
CleraFields();
}
catch (Exception ex)
{
JQUERYDisplay.ShowAlertMessage(ex.Message);
}
finally
{
}
}
You can find the table here
https://picasaweb.google.com/lh/photo/QmT9efouyNXD85fyuF7KaNMTjNZETYmyPJy0liipFm0?feat=directlink[
^]