Strongly typed datasets and web services

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PeterH

    #1

    Strongly typed datasets and web services

    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.Obje ct)
    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 ***
  • vbnetdev

    #2
    Re: Strongly typed datasets and web services

    "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.
    --
    Get a powerful web, database, application, and email hosting with KJM
    Solutions




    "PeterH" <nospam@devdex. com> wrote in message
    news:%23mHOU1Le GHA.1856@TK2MSF TNGP03.phx.gbl. ..[color=blue]
    >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.Obje ct)
    > 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 ***[/color]


    Comment

    Working...