int flag=0;
   Connection.Open();
   string sql="insert into MsgInfo(title,content,sendtime) values('"+bVO.Subject+"','"+bVO.Content+"','"+bVO.Fbtime+"')";
   SqlCommand sqlComm = new SqlCommand(sql,Connection);
   flag = sqlComm.ExecuteNonQuery();
   sql="select @@identity as id from MsgInfo";
   sqlComm = new SqlCommand(sql,Connection);
   SqlDataReader tmpReader = sqlComm.ExecuteReader();
   if(tmpReader.Read())
   {
    flag = Convert.ToInt32(tmpReader["id"].ToString());
  
}
   Connection.Close();
   return flag;

相关文章:

  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2021-08-19
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2021-10-13
  • 2022-01-30
  • 2022-01-09
  • 2022-12-23
  • 2021-10-24
相关资源
相似解决方案