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