PC Review


Reply
Thread Tools Rate Thread

delegates and typed datasets

 
 
=?Utf-8?B?TWFnYWxpIERlc21lZHQ=?=
Guest
Posts: n/a
 
      17th Mar 2005
Hi,

I have this delegate: public delegate DataSet TestDelegate1(string code);
But when I try to pass methods that return a typed dataset instead of a
regular dataset I get an error saying the method does not match the delegate.
Is there a way around that?

Thanks.
 
Reply With Quote
 
 
 
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      17th Mar 2005
Hi,

AFAIk the signature should be exact , think what would happen if you have
another delegate with the typed dataset as the return type, at compile time
which one to use?

the solution is fast though , just create another method with the correct
signature and make it return the correct type, like this

DataSet wrapper( string code)
{
return realMethod( code);
}

where realMethod return the typed dataset.


cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



"Magali Desmedt" <(E-Mail Removed)> wrote in message
news:59878A8F-9F2A-4E7E-9897-(E-Mail Removed)...
> Hi,
>
> I have this delegate: public delegate DataSet TestDelegate1(string code);
> But when I try to pass methods that return a typed dataset instead of a
> regular dataset I get an error saying the method does not match the
> delegate.
> Is there a way around that?
>
> Thanks.



 
Reply With Quote
 
=?Utf-8?B?TWFnYWxpIERlc21lZHQ=?=
Guest
Posts: n/a
 
      17th Mar 2005
Ok, thanks!

"Ignacio Machin ( .NET/ C# MVP )" wrote:

> Hi,
>
> AFAIk the signature should be exact , think what would happen if you have
> another delegate with the typed dataset as the return type, at compile time
> which one to use?
>
> the solution is fast though , just create another method with the correct
> signature and make it return the correct type, like this
>
> DataSet wrapper( string code)
> {
> return realMethod( code);
> }
>
> where realMethod return the typed dataset.
>
>
> cheers,
>
> --
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>
>
>
> "Magali Desmedt" <(E-Mail Removed)> wrote in message
> news:59878A8F-9F2A-4E7E-9897-(E-Mail Removed)...
> > Hi,
> >
> > I have this delegate: public delegate DataSet TestDelegate1(string code);
> > But when I try to pass methods that return a typed dataset instead of a
> > regular dataset I get an error saying the method does not match the
> > delegate.
> > Is there a way around that?
> >
> > Thanks.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is meant by typed/untyped/strongly typed datasets? Rachana Microsoft VB .NET 4 14th Nov 2007 07:11 PM
Using Typed Datasets in asp.net 2.0 amit@c4ppy.net Microsoft ASP .NET 2 11th Apr 2006 02:36 PM
Convering typed and un-typed datasets to each other A.M-SG Microsoft ADO .NET 6 6th Oct 2005 08:28 PM
Typed DataSets returned as regular datasets =?Utf-8?B?Sm9uIEtpbmc=?= Microsoft ADO .NET 2 29th Aug 2004 01:41 AM
Converting Untyped Datasets into Strongly Typed Datasets with Foreign Key Constraints. Alex Berryhill Microsoft ADO .NET 2 19th Mar 2004 02:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:08 AM.