- 作者: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();
}