|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Strongly typed datasets and web servicesI am developing a web service in VB.Net that returns data from a server.
I have an .asmx page that uses a strongly typed dataset and I would like to return data in the form of strongly typed data table rows. However I always get an error message to do with the fact that the data set is not serializable. For example: "You must implement the Add(System.Object) method on xyz data table because it inherits from IEnumerable." The strongly typed data set objects are created automatically in Visual Studio from the data set schema. Is there a way to force Visual Studio (2003 version) to implement the necessary methods to make the data set serializable? Peter *** Sent via Developersdex http://www.developersdex.com *** "A class that implements IEnumerable must implement a public Add method that
takes a single parameter. The Add method's parameter must be of the same type as is returned from the Current property on the value returned from GetEnumerator, or one of that type's bases. " That said, support for datatable object in 2003 for what you are trying to do is not a simple matter. Try returning it back as another dataset (create it at that end and copy the table) and then returning that dataset. Or upgrade to VS 2005. Though I have not tested it I have heard this problem goes away in 2.0. -- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "PeterH" <nospam@devdex.com> wrote in message news:%23mHOU1LeGHA.1856@TK2MSFTNGP03.phx.gbl... >I am developing a web service in VB.Net that returns data from a server. > I have an .asmx page that uses a strongly typed dataset and I would like > to return data in the form of strongly typed data table rows. However I > always get an error message to do with the fact that the data set is not > serializable. For example: "You must implement the Add(System.Object) > method on xyz data table because it inherits from IEnumerable." > > The strongly typed data set objects are created automatically in Visual > Studio from the data set schema. Is there a way to force Visual Studio > (2003 version) to implement the necessary methods to make the data set > serializable? > > Peter > > *** Sent via Developersdex http://www.developersdex.com ***
eventlog monitoring
Change Screen Resolution in VB.NET????? indirectly setting a property of a class can I write a select ..where.. against a table in a dataset? File difference algorithm Not inheriting members from the base force next iteration in for...next excel range: how to tell it to move one row down? How many jobs are waiting in the printer's queue Help needed to locate Documentation Authoring Tool for VB.Net 2.0 |
|||||||||||||||||||||||