RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:9:30-18:00
你可能遇到了下面的问题
关闭右侧工具栏
messagequeue的事务
  • 作者:xiaoxiao
  • 发表时间:2020-12-23 10:54
  • 来源:未知

private void sendmsg()  {   System.Data.OleDb.OleDbConnection myconn=new OleDbConnection("Provider=SQLOLEDB;User Id=sa;password=;DataSource=172.26.230.14;initial catalog=eAB-UC");   myconn.Open();   DataSet ds=new DataSet();   OleDbDataAdapter myadap=new OleDbDataAdapter("select top 5 * from s_khxx",myconn);   myadap.Fill(ds,"details");      myconn.Close();      

   //声名队列对象及消息对象   System.Messaging.MessageQueueTransaction objtran=new MessageQueueTransaction();   System.Messaging.Message objMsg=new System.Messaging.Message();   

   objtran.Begin();   objMsg.Label="0000011111";   objMsg.Body=ds;

   System.Messaging.MessageQueue objque=new System.Messaging.MessageQueue("FormatName:DIRECT=TCP:172.26.230.95//private$//22222send");   objque.Send(objMsg,objtran);            objtran.Commit();

  }