L
Laszlo Csabi
Hi Folks,
I got a problem with message queue. I want to put a row of a dataset into
the message body and when I send it to the Q I throws an Exception.
Error message is : YNOTCALLME.MULTISOFT.ENTITY.dsDistributor.DistributorRow
cannot be serialized because it does not have a default public constructor
I have the following methos which throw the exception:
private void
Send2VoiceRoomQ(YNOTCALLME.MULTISOFT.ENTITY.dsDistributor.DistributorRow
row)
{
try
{
if(MessageQueue.Exists(VOICEQ))
{
//creates an instance MessageQueue, which point to the already existing
MyQueue
mqv = new System.Messaging.MessageQueue(VOICEQ);
}
else
{
//creates a new private queue called VOICEQ
mqv = MessageQueue.Create(VOICEQ);
}
mqv.Formatter = new System.Messaging.XmlMessageFormatter();
for ( int i=0; i < dsDistibutor.Distributor.Rows.Count ; i++ )
{
System.Messaging.Message mm = new System.Messaging.Message();
mm.Label = row["dm_lname"].ToString () + " " + row["dm_fname"].ToString () ;
mm.Body = row;
mqv.Send(mm);
}
}
catch( Exception ex )
{
FRAMEWORK.ERRORMANAGER.Error.Save (ex.Message,ex.Source ,ex.StackTrace ,"");
}
}
What I would like to achive is put a row of the dataset into the message and
send it to the MSMQ.
Any idea if is that possible?
Thanks
Laszlo
I got a problem with message queue. I want to put a row of a dataset into
the message body and when I send it to the Q I throws an Exception.
Error message is : YNOTCALLME.MULTISOFT.ENTITY.dsDistributor.DistributorRow
cannot be serialized because it does not have a default public constructor
I have the following methos which throw the exception:
private void
Send2VoiceRoomQ(YNOTCALLME.MULTISOFT.ENTITY.dsDistributor.DistributorRow
row)
{
try
{
if(MessageQueue.Exists(VOICEQ))
{
//creates an instance MessageQueue, which point to the already existing
MyQueue
mqv = new System.Messaging.MessageQueue(VOICEQ);
}
else
{
//creates a new private queue called VOICEQ
mqv = MessageQueue.Create(VOICEQ);
}
mqv.Formatter = new System.Messaging.XmlMessageFormatter();
for ( int i=0; i < dsDistibutor.Distributor.Rows.Count ; i++ )
{
System.Messaging.Message mm = new System.Messaging.Message();
mm.Label = row["dm_lname"].ToString () + " " + row["dm_fname"].ToString () ;
mm.Body = row;
mqv.Send(mm);
}
}
catch( Exception ex )
{
FRAMEWORK.ERRORMANAGER.Error.Save (ex.Message,ex.Source ,ex.StackTrace ,"");
}
}
What I would like to achive is put a row of the dataset into the message and
send it to the MSMQ.
Any idea if is that possible?
Thanks
Laszlo