|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Generics (input - output) either dataset or typed datasetGenerics are new to me.
I want to write a function that accepts a generic parameter that is either a dataset or a typed dataset. Have the function fill that object and return it. Is this possilbe without casting it as an object and then ctype the returned object to the desired type. I thought generics will allow me to pass a dataset and have it filled or pass a typed dataset and have it filled, using the same function. Thank you for your help, Karl I haven't really done much with generics, but something like this should
work: Public Function FillDataSet(Of T As DataSet)(ByVal ds As T) As T End Function /claes Show quoteHide quote "Karl 140.6" <Karl1***@discussions.microsoft.com> wrote in message news:AFABAE66-DAC9-4F77-A3EE-42305F9A0373@microsoft.com... > Generics are new to me. > > I want to write a function that accepts a generic parameter that is either > a > dataset or a typed dataset. Have the function fill that object and return > it. > > Is this possilbe without casting it as an object and then ctype the > returned > object to the desired type. > > I thought generics will allow me to pass a dataset and have it filled or > pass a typed dataset and have it filled, using the same function. > > Thank you for your help, > > Karl
I miss loop
length of string Adding Button Programatically - have an answer??? Sub Main is not waiting!!!?? Visual Studio 2003 Menu on form.vb best way to tell if a date is not assigned? Where is ThisWorkbook.Sheets("xx") ?? Unable to resolve 'ThisWorkbook' :: Interop to Excel XmlDocument object to string - plase help with unusual character! Visual Basic .NET Resource Kit Form Size |
|||||||||||||||||||||||