Problem Localhost Web Reference method (fails showing return type)
-
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
-
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
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
-
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
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?
-
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?
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
-
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
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
-
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
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
-
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
-
I build a minimal dataset: Dim Ds as new DataSet Ds.Tables.Add(MyTable) return(Ds) Thanks for your patient.
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