Is WeService returns a datatable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kishorereddyambati
    New Member
    • Jan 2008
    • 3

    Is WeService returns a datatable

    Hello, I created a Web Service using .Net 2.0 that has a function that
    returns a DataTable. I can test the function from the web page when I access
    the .asmx from a browser on localhost and it works. I can also test the
    function using VB6 and the xmlhttp activex object. The problem I have now is
    when using VS 2005 or VB.Net 2005 Express and creating a web references is
    that the proxy created doesn't map the function as returning a DataTable
    instead returns some other type of object named xxxxResult where xxxx is the
    name of the web service function. I have another function that returns a
    DataSet that works perfectly with the web reference although I'd rather use a
    DataTable since I won't need all the functionality that a DataSet brings.
    Anyone have the same problem and found a solution?
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by kishorereddyamb ati
    Hello, I created a Web Service using .Net 2.0 that has a function that
    returns a DataTable. I can test the function from the web page when I access
    the .asmx from a browser on localhost and it works. I can also test the
    function using VB6 and the xmlhttp activex object. The problem I have now is
    when using VS 2005 or VB.Net 2005 Express and creating a web references is
    that the proxy created doesn't map the function as returning a DataTable
    instead returns some other type of object named xxxxResult where xxxx is the
    name of the web service function. I have another function that returns a
    DataSet that works perfectly with the web reference although I'd rather use a
    DataTable since I won't need all the functionality that a DataSet brings.
    Anyone have the same problem and found a solution?
    you know that whether its dataset or datatable you want to return from a .NET Web Service, its must be XMLSerializable .
    in .net 1.1 a datatable/datarow/dataview was not XMLSerializable.
    but in .net 2.0 a datatable is serializable ,so that means you can return them from a web service (though you must fill the tablename property first).You must generate the proxy class using the 2.0 version of the WSDL tool else you will get the odd named returned types that you are seeing.(Since ASP.Net 1.1 didnt support it)

    Comment

    Working...