Skip to main content
Go Search

Ayman El-Hattab's Blog [MVP]

Ayman El-Hattab's Blog
Marwan Tarek's Blog
Mohamed Yehia's Blog

SharePoint 4 Arabs - Online SharePoint Training, Video Tutorials and Webcasts in Arabic > Ayman El-Hattab's Blog [MVP] > Posts > Querying MSMQ Messages Using LINQ
Querying MSMQ Messages Using LINQ
In a project that I'm currently working on, I needed to retrieve messages from MSMQ based on some criteria, I used LINQ to do that and would like to share this code with you. MessageQueue messageQueue = new MessageQueue(Constants.MessageQueueName); messageQueue.Formatter = new BinaryMessageFormatter(); var TrackingRecords = from System.Messaging.Message message in messageQueue where message.Label.Contains(Constants.MessageLabel) select (ICLGRecord)message.Body; // Itterate through the Messages foreach (var TrackingRecord in TrackingRecords) { } // Remove All Items From MSMQ messageQueue.Purge();


There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.


Body *