protected void Button1_Click(object sender, EventArgs e)
{
string a = DateTime.Now.ToString();
string b = Session["loginName"].ToString();
int i = int.Parse(b);
SqlConnection sqlconnection =new SqlConnection ( "Server=(local);uid=sa;pwd=;database=BBS") ;
SqlCommand sqlcommand = new SqlCommand();
sqlconnection.Open();
sqlcommand.Connection = sqlconnection;
sqlcommand.CommandText = "insert into Issue(Title,Content,UserID,[Date]) values( '"+ TextBox1.Text +"' , '"+ TextBox2.Text +"','"+b+"','"+a+"')";
sqlcommand.ExecuteNonQuery();
sqlcommand = null;
sqlconnection.Close();
sqlconnection = null;
Response.Write("<script>alert('提交成功')</script>");
TextBox1.Text = "";
TextBox2.Text = "";
}
{
string a = DateTime.Now.ToString();
string b = Session["loginName"].ToString();
int i = int.Parse(b);
SqlConnection sqlconnection =new SqlConnection ( "Server=(local);uid=sa;pwd=;database=BBS") ;
SqlCommand sqlcommand = new SqlCommand();
sqlconnection.Open();
sqlcommand.Connection = sqlconnection;
sqlcommand.CommandText = "insert into Issue(Title,Content,UserID,[Date]) values( '"+ TextBox1.Text +"' , '"+ TextBox2.Text +"','"+b+"','"+a+"')";
sqlcommand.ExecuteNonQuery();
sqlcommand = null;
sqlconnection.Close();
sqlconnection = null;
Response.Write("<script>alert('提交成功')</script>");
TextBox1.Text = "";
TextBox2.Text = "";
}