C# .NET - how to serialize dbparameters in c# - Asked By sandy patel on 09-Oct-13 05:54 AM


I want to serialize DBParameter.but it gives following error when trying to serialize

"Use the XmlInclude or SoapInclude attribute to specify types that are not known statically."

here is my code

public class DemoClass{
public List<DbParameter> Parameters { get; set; }

can anybody help me to sortout this issue ? how can I serialize Parameters property ?


Robbe Morris replied to sandy patel on 09-Oct-13 09:03 AM
The DBParameter class would need to implement that and I don't think it does.  From a design perspective, why would use a class you cannot control or alter as a parameter in some sort of service method?