MSMQ problem

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
 
E

Eric

just send the whole DataSet - it's serializable.

You don't need to create an XML formatter bec. that's the default.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top