473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

return object from WebMethod

Hi there,

I try to create a webmethod in webservice by return DataView but each time I
compile there is and error
[WebMethod]
public DataView GetAuthor(){
.....
return ds.Tables["Authors"].DefaultView;
}

You must implement the Add(System.Data.DataRowView) method on
System.Data.DataView because it inherits from ICollection.

Please kindly advice.

Regards
Nov 16 '05 #1
2 3768
Essentially whats happening is that VS.net creates a proxy class called
Reference.cs. Out there it defines the DataView property which is
obviously not implemented correctly as its only a placeholder value
object. Try changing the DataView return type to object and you should
be good to go
Thanks

kids_pro wrote:
Hi there,

I try to create a webmethod in webservice by return DataView but each time I
compile there is and error
[WebMethod]
public DataView GetAuthor(){
.....
return ds.Tables["Authors"].DefaultView;
}

You must implement the Add(System.Data.DataRowView) method on
System.Data.DataView because it inherits from ICollection.

Please kindly advice.

Regards


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
Nov 16 '05 #2
many thanks
"Dilip Krishnan" <dilipdotnet..NOSPAM..@apdiya.com> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Essentially whats happening is that VS.net creates a proxy class called
Reference.cs. Out there it defines the DataView property which is
obviously not implemented correctly as its only a placeholder value
object. Try changing the DataView return type to object and you should
be good to go
Thanks

kids_pro wrote:
Hi there,

I try to create a webmethod in webservice by return DataView but each time I compile there is and error
[WebMethod]
public DataView GetAuthor(){
.....
return ds.Tables["Authors"].DefaultView;
}

You must implement the Add(System.Data.DataRowView) method on
System.Data.DataView because it inherits from ICollection.

Please kindly advice.

Regards


--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bruce W.1 | last post by:
The intent of my web service is an RSS feed from a blog. Originally I used a StringBuilder to make the XML and returned a string from the webmethod. But this doesn't display properly in IE. So...
1
by: kids_pro | last post by:
Hi there, I try to create a webmethod in webservice by return DataView but each time I compile there is and error public DataView GetAuthor(){ ..... return ds.Tables.DefaultView; }
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
6
by: Whoever | last post by:
Here's what I have A custom collection: public class aUser { public string UserName { get {...} set {...} } public class UserList : System.Collection.CollectionBase { public void Add(aUser...
0
by: Henke | last post by:
Hi I have a webservice that should return a result object, like this: public class Result { private object data; private int status; public object Data { get{return data;}
1
by: Thomas D. | last post by:
Hello all, I'm using the IXmlSerializable interface for a project and encounter some problems when testing my webservice in a client application. I know this interface is undocumented and not...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
4
by: Military Smurf | last post by:
I'm interested in writing a web service that will return more than one value. What's the best way to accomplish this? I was wondering if an array would be best, but I'd like to know if there is a...
4
by: Jonathan | last post by:
I have a SQL stored procedure for adding a new record in a transactions table. It also has two return values: CounterID and IDKey. I want to create a webservice that accepts the 10 input...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.