I'm writing a web service that I want to return a strongly typed collection.
If I inherit System.collections.generic.list(of T) it returns an ArrayOfT.
If I inherit CollectionsBase, it also returns an ArrayOf. I want the root
xml element to just be of the class itself (if that makes any sense). Is
this even possible? What do I need to inherit?
If you want a strong object/collection on the outside world (of a web
service)...then the client needs to know something about some kind of strong
collection.
..
Take a look here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
I have a IZebraCollection......which the service and the host know about.
Its WCF, but WCF can be exposed as a webservice.
..
"Dave T" <DaveT@.discussions.microsoft.com> wrote in message
news:A1A6AA44-6974-4B5C-9C11-795D570F46A7@.microsoft.com...
> I'm writing a web service that I want to return a strongly typed
> collection.
> If I inherit System.collections.generic.list(of T) it returns an ArrayOfT.
> If I inherit CollectionsBase, it also returns an ArrayOf. I want the root
> xml element to just be of the class itself (if that makes any sense). Is
> this even possible? What do I need to inherit?
Showing posts with label writing. Show all posts
Showing posts with label writing. Show all posts
Thursday, March 22, 2012
Strongly Typed Collections
Strongly Typed dataset
Hello,
I have a typed dataset defined in my project. I am writing a user control
which needs to invoke an instance of that dataset. Problem is that the page
developer only provides the name of the dataset to my user control.
I want my user control to invoke an instance of that dataset from its
"string" representation of the type.
I used type.gettype("Mydatasettype") , but ctype function would not accept
it as a valid type.
Any help is appreciated.Like any other compiled class the generated strongly-typed DataSet can be
accessed by System.Reflection at run-time. The easiest way to do this is
probably with the Activator.CreateInstance(..) method, but I'm fairly
certain you'll have to load the Assembly that has the DataSet in it manually
(if it's not already loaded - you'll have to check for that as well).
Does that help?
Richard
--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
"Imran" <imran_halim@.hotmail.com> wrote in message
news:On5uAAX4DHA.488@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I have a typed dataset defined in my project. I am writing a user control
> which needs to invoke an instance of that dataset. Problem is that the
page
> developer only provides the name of the dataset to my user control.
> I want my user control to invoke an instance of that dataset from its
> "string" representation of the type.
> I used type.gettype("Mydatasettype") , but ctype function would not accept
> it as a valid type.
> Any help is appreciated.
I have a typed dataset defined in my project. I am writing a user control
which needs to invoke an instance of that dataset. Problem is that the page
developer only provides the name of the dataset to my user control.
I want my user control to invoke an instance of that dataset from its
"string" representation of the type.
I used type.gettype("Mydatasettype") , but ctype function would not accept
it as a valid type.
Any help is appreciated.Like any other compiled class the generated strongly-typed DataSet can be
accessed by System.Reflection at run-time. The easiest way to do this is
probably with the Activator.CreateInstance(..) method, but I'm fairly
certain you'll have to load the Assembly that has the DataSet in it manually
(if it's not already loaded - you'll have to check for that as well).
Does that help?
Richard
--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
"Imran" <imran_halim@.hotmail.com> wrote in message
news:On5uAAX4DHA.488@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I have a typed dataset defined in my project. I am writing a user control
> which needs to invoke an instance of that dataset. Problem is that the
page
> developer only provides the name of the dataset to my user control.
> I want my user control to invoke an instance of that dataset from its
> "string" representation of the type.
> I used type.gettype("Mydatasettype") , but ctype function would not accept
> it as a valid type.
> Any help is appreciated.
Subscribe to:
Posts (Atom)