Santosh Reddy

Santosh Reddy

  • NA
  • 64
  • 20.9k

i got the some error

Mar 6 2017 8:00 AM
protected void Page_Load(object sender, EventArgs e)
{
string r = @"server=.;database=romesh;trusted_connecton=true";
SqlConnection con = new SqlConnection(r);
}
protected void btn_insert_Click(object sender, EventArgs e)
{
string i= "insert into sample values('"+txt1.Text+"','"+txt2.Text+"','"+txt3.Text+"')";
con.open();
SqlCommand cmd = con.createcommend();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "i";
cmd.EndExecuteNonQuery();
con.close();
}
}
// I will get the error my code

Answers (12)