Home > Net >  The content of the Textxbox imported into the database
The content of the Textxbox imported into the database

Time:09-25

Protected void Button1_Click (object sender, EventArgs e)
{
String STR="Data Source=. Initial Catalog=bysjDB; Integrated Security=True ";
SqlConnection con=new SqlConnection (STR);
String STRSQL="insert into db_notice (db_ID db_notice) values ('" + TextBox2. Text + "', '" + TextBox1. Text +") ";
SqlCommand CMD=new SqlCommand (STRSQL, con);
Con. The Open ();
CMD. ExecuteNonQuery ();
Con. The Close ();

}

CodePudding user response:

So what is your problem?
  •  Tags:  
  • C#
  • Related