Can you please explain why is it so... Also It will be helpful if u can explain what is "datarow with parameterless constructor", an example will help me a long way -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Phil Sayers Sent: Wednesday, October 18, 2006 06:36 PM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] Serializing a datarow in webservices
a datarow is not serializable. you should return a datatable with a single row in it....or a custom object that contains the information. -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Manoj Aggarwal Sent: Wednesday, October 18, 2006 2:08 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] Serializing a datarow in webservices Dear Friends, I am trying the return a datarow from a webmethod. I am getting the following error when I try to add the webreference in my windows forms code: DSOrders.DTInvoiceSelectByBookingIdRow can not be serialized because it does not have parameterless constructor. I am using the following code: [WebMethod] public DSOrders.DTInvoiceSelectByBookingIdRow GetInvoiceByBookingId(Int64 BookingId) { DAInvoiceSelectByBookingId objDa = new DAInvoiceSelectByBookingId(); DSOrders.DTInvoiceSelectByBookingIdDataTable dtInvoice; try { dtInvoice = objDa.GetInvoiceByBookingId(BookingId); } catch (Exception ex) { throw ex; } if (dtInvoice.Rows.Count == 0) { throw new Exception("Invalid BookingId"); } DSOrders.DTInvoiceSelectByBookingIdRow dr = (DSOrders.DTInvoiceSelectByBookingIdRow)dtInvoice.Rows[0]; return dr; } Tried to google, but of now use. Thanks, Manoj =================================== This list is hosted by DevelopMentor. http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor. http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com