Is Collection serialized?
Main Topics
Browse All TopicsI am creating a web method which returns a DataTable. Here is the code:
private DataTable Order;
private DataColumn OrderCol;
private DataRow DataRow;
private DataTable AssignOrder(string OrderNum)
{
this.Order = new DataTable("OrderStatus");
this.OrderCol = Order.Columns.Add("OrderNu
OrderCol.AllowDBNull = false;
OrderCol.Unique = true;
Order.Columns.Add("OrderSt
this.OrderRow = Order.NewRow();
OrderRow["OrderNum"] = OrderNum;
OrderRow["OrderStatus"] = "SHIPPED";
Order.Rows.Ass(OrderRow);
return Order;
}
[WebMethod()]
public DataTable GetOrderStatus(string OrderNum)
{
DataTable OrderStatus = AssignOrder(OrderNum);
return OrderStatus;
}
The compilation is successful. However, when I test the web service, it shows the error when I tried to bring up the web service list (access //localhost/WebService1/Se
Cannot serialize member System.ComponentModel.mars
Actually, sorting through the stack, I found the there is an error "method Service1.GetOrderStatus can not be reflected.".
Is there anyoine can figure what's wrong with it?
Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The DataTable, DataRow, DataView, and DataViewManager objects cannot be serialized and cannot be returned from an XML Web service. To return less than a complete DataSet, you must copy the data that you want to return to a new DataSet.
Please read the following URL from microsoft site
http://support.microsoft.c
I think so it will be helpful for you.
Cheers
Amir
Business Accounts
Answer for Membership
by: testnPosted on 2005-03-14 at 19:20:39ID: 13541455
datatable cannot be serialized into xml. Please consider to use DataSet instead.