Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Problem Localhost Web Reference method (fails showing return type)

Problem Localhost Web Reference method (fails showing return type)

Scheduled Pinned Locked Moved Visual Basic
helpannouncementcsharpvisual-studio
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    edmonson
    wrote on last edited by
    #1

    Hi ! I have an object named RemoteDb that is implemented as a web service. It has a method named RemoteSql than accepts an input string and returns a system.data.datatable with the results. I've been working for a few days referencing it from VB and all works fine. This morning I have done some modifications to webservice and so, i have rebuilt it. From explorer, it continues working fine, but when I've updated the web reference from my applicaction (Vb.net IDE), this error has appeared: Value of type 'RegantsAlgerri.WebReference.RemoteSqlResponseRemoteSqlResult' can not be converted to 'System.Data.DataTable'. When i call the webmethod RemoteSql() .net environment explains me that return parameter is RegantsAlgerri.WebReference.RemoteSqlResponseRemoteSqlResult. In previous version (before update Web Reference) .net environment tells me that return type was System.Data.DataTable. Why reference is loaded with this bad return type ? Regards in advance

    V 1 Reply Last reply
    0
    • E edmonson

      Hi ! I have an object named RemoteDb that is implemented as a web service. It has a method named RemoteSql than accepts an input string and returns a system.data.datatable with the results. I've been working for a few days referencing it from VB and all works fine. This morning I have done some modifications to webservice and so, i have rebuilt it. From explorer, it continues working fine, but when I've updated the web reference from my applicaction (Vb.net IDE), this error has appeared: Value of type 'RegantsAlgerri.WebReference.RemoteSqlResponseRemoteSqlResult' can not be converted to 'System.Data.DataTable'. When i call the webmethod RemoteSql() .net environment explains me that return parameter is RegantsAlgerri.WebReference.RemoteSqlResponseRemoteSqlResult. In previous version (before update Web Reference) .net environment tells me that return type was System.Data.DataTable. Why reference is loaded with this bad return type ? Regards in advance

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      Well its Difficult to say, especially if we dont see the code. but i think you have tempered with the return type when you were doing modification this morning. Lets see how you wrote your function that return that datatable and we can point where the Problem is.

      Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

      E 1 Reply Last reply
      0
      • V Vimalsoft Pty Ltd

        Well its Difficult to say, especially if we dont see the code. but i think you have tempered with the return type when you were doing modification this morning. Lets see how you wrote your function that return that datatable and we can point where the Problem is.

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        E Offline
        E Offline
        edmonson
        wrote on last edited by
        #3

        Hello again, Next description is more aproximated about problem is: 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. 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?

        V 1 Reply Last reply
        0
        • E edmonson

          Hello again, Next description is more aproximated about problem is: 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. 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?

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          Still until you show us the code, we will not know what is the problem, try to post your code

          Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

          E 1 Reply Last reply
          0
          • V Vimalsoft Pty Ltd

            Still until you show us the code, we will not know what is the problem, try to post your code

            Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

            E Offline
            E Offline
            edmonson
            wrote on last edited by
            #5

            Using DataSet and not DataTable as method argument and/or return type, the client application recognizes de types, and so it works. I've looking other forums, and other people has the same problem. Solution has not been found, but everybody is using DataSet vs. DataTable. Microsoft exposes this article, recommendating using DataSets: http://support.microsoft.com/kb/306134

            V 1 Reply Last reply
            0
            • E edmonson

              Using DataSet and not DataTable as method argument and/or return type, the client application recognizes de types, and so it works. I've looking other forums, and other people has the same problem. Solution has not been found, but everybody is using DataSet vs. DataTable. Microsoft exposes this article, recommendating using DataSets: http://support.microsoft.com/kb/306134

              V Offline
              V Offline
              Vimalsoft Pty Ltd
              wrote on last edited by
              #6

              Its True , you have to return a dataset.but you must filter it, dont return everything, because you might return a large sum of data that might not be needed by your application and consume a lot of resources

              Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

              E 1 Reply Last reply
              0
              • V Vimalsoft Pty Ltd

                Its True , you have to return a dataset.but you must filter it, dont return everything, because you might return a large sum of data that might not be needed by your application and consume a lot of resources

                Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

                E Offline
                E Offline
                edmonson
                wrote on last edited by
                #7

                I build a minimal dataset: Dim Ds as new DataSet Ds.Tables.Add(MyTable) return(Ds) Thanks for your patient.

                V 1 Reply Last reply
                0
                • E edmonson

                  I build a minimal dataset: Dim Ds as new DataSet Ds.Tables.Add(MyTable) return(Ds) Thanks for your patient.

                  V Offline
                  V Offline
                  Vimalsoft Pty Ltd
                  wrote on last edited by
                  #8

                  Thats Fine, what you did is good. Rememmber Patience is better than Pride, am glad you got your solution rate my post

                  Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups