static void Main(string[] args) { //get data from db first var datafromdb = new DataMapper(); // Collection<CallDispositions> result=datafromdb.GetCallDespositionsInfo(); var result = new Collection<CallDispositions>(); var testdata1 = new CallDispositions(); testdata1.ActionCode = "test"; testdata1.AgentInitials = "PM"; testdata1.CallDate = Convert.ToDateTime("2016/01/13"); testdata1.CallStartStr = "test"; testdata1.CampaignId = 4; testdata1.CubsAccountNumber = 12345; testdata1.DurationSeconds = "55"; result.Add(testdata1); //send result to messaging queue try { var req = new SendMsgToQueue(); req.SendMessageToQueue(queueName, result); } catch (Exception ex) { Console.WriteLine("unable to queue message", ex.StackTrace); } }
static void Main(string[] args) { //Create new Queue { CreateMessageQueue queue = new CreateMessageQueue(); queue.CreateQueue(queueName1); queue.CreateQueue(queueName2); } //get data from db first var datafromdb = new DataMapper(); var result = datafromdb.GetCallDespositionsInfo(); var req = new SendMsgToQueue(); foreach (var row in result) { //send result to messaging queue try { req.SendMessageToQueue(queueName1, row); } catch (Exception ex) { Console.WriteLine("unable to queue message {0}", ex.StackTrace); } } }