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