You cannot send objects that aren't serializeable. One workaround is to
parse the contents of the row as a delimited string and send the string. Or
you can try subclassing the row object to implement a serializer but that
sounds like useless work to me.
--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at
www.lulu.com/owc --------------------------------------------------
[quoted text, click to view] "Laszlo Csabi" <lc@ynotcallme.com> wrote in message
news:%23ahoVJoAFHA.1452@TK2MSFTNGP11.phx.gbl...
> 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
>
>