Santosh Reddy

Santosh Reddy

  • NA
  • 64
  • 20.6k

error will come in my programme

Jun 23 2017 5:21 AM
private void BtnInsert_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection("server=.;database=romesh;integrated security=true");
SqlCommand cmd = new SqlCommand("insert into ObjectMethodChecking values('" + TxtFname.Text + "','" + TxtSurname.Text + "','" + Txtaddress.Text + "'," + TxtPhno.Text + ")", con);
cmd.CommandType = CommandType.Text;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
 
error will come below my attachment 

Attachment: Screenshot_(39).zip

Answers (1)