Dr. Rajesh Rolen
Dr. Rajesh Rolen

Reputation: 14285

What should be returned from web service instead of datatable?

I have created a web service in which i need to return multiple records from a function. For that I used datatable, but found that as it cannot be serialized. So we can't use it. So I used dataset instead of datatable. My service is going to be used in PHP. I am not sure that they (PHP developers) will be able to get data from my dataset (returned from my webservice's function) or not.

Please suggest me what I should return. Dataset or is there any other better option available?

Thanks.

Upvotes: 0

Views: 734

Answers (2)

Henrik P. Hessel
Henrik P. Hessel

Reputation: 36617

Use a cross-platform dataformat like XML or JSON that both worlds (PHP & C#) understand.

Upvotes: 2

Joe
Joe

Reputation: 57179

I would create a serializable class that can represent each record in the data set and then return a collection of that.

Upvotes: 1

Related Questions