473,387 Members | 1,757 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,387 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 3767
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.