Typed DataSet cannot be serialized.

Hi,

I have created a WCF Service. When I start the service I receive the following error.

Type 'dsChamberConfig+ChamberConfigRow' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.

My interface is defined as follows

[ServiceContract()]
public interface IRemoteComms
{
[OperationContract]
bool InitializeChamber(dsChamberConfig.ChamberConfigRow row);
}

I have tried to include DataContractAttribute and DataMemberAttribute attributes in my dataset class file. I am not sure what to do from here?

[682 byte] By [JacquesViviers] at [2008-1-4]
# 1
Can you show us your DataSet class file?
DaveCliffe-MSFT at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 2

The problem is that in fact the DataRow type is not serializable. My recomendation is to create entities (More known as DataContracts in WCF) and use it to transfer the info of one row to the service and viceversa. Then when you need to add the row to the datatable, use a Type translator to copy the sended data to your row type.

# 3
Thanks for your reply. I managed to overcome the problem by passing a serialized object instead of the datarow.
JacquesViviers at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 4
Hi all,

This is not solution of problem.
Which is i am facing just now.
I am also trying to pass dataset instead of dataraw via WCF.
But i am getting same problem.
If anybody knows the solution please inform me ASAP.

Regards
Pratik

Pratik123 at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...
# 5
Can you share this code? I am writing a similar service where I'm trying to pass an entire datarow. My datasets in the CLIENT and HOST are identical. I would appreciate your help. I tried everything and I can't figure this out. None of the MSFT examples have worked and I've spent too much time reading that goes NO WHERE.
JohnCosmas at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Communication Foundation (Indigo)...

Visual Studio Orcas

Site Classified