M
moondaddy
I have a winforms app built on vb.net & vs2003, and all data access is via
webservices which call SPs on sql server 2k. For performance reasons I need
to make the datasets returned from the server as lean as possible so what I
have been doing is creating strongly typed datasets and then in the designer
I've made all rows attributes instead of elements. Then to reduce some of
the remaining 'un-needed' text in the dataset I've set the properties
attributeFormDefault and elementFormDefault to unqualified in the properties
window. then with the normal code I create an sql data adapter and use the
fill method with this data adapter and strongly typed dataset. This
produces the results that I want. The problem is that as the application
grow, I'm getting a lot of datasets in the designer (not to mention that
fact that I also need to manage a naming convention to keep all of these
datasets organized). And the only think most of these dataset are used for
is to assist in generating datasets with as little text as possible for
sending across the wire. They aren't used for validation or managing data
in anyway. It would be MUCH cleaner if I could generate these attribute
based datasets on the fly with out using strongly typed datasets.
Question: is it possible to create a dataset on the fly where all the rows
are elements and all the columns are attributes and populate it using the
fill method. I would need to define the element name of the rows such as
"r", and it would be ideal if the attribute names to be automatically named
after the column names returned by the sp. Is there a way to do this with
out a lot of code? Whether there is or isn't, what's the best way to do
this?
Thanks.
webservices which call SPs on sql server 2k. For performance reasons I need
to make the datasets returned from the server as lean as possible so what I
have been doing is creating strongly typed datasets and then in the designer
I've made all rows attributes instead of elements. Then to reduce some of
the remaining 'un-needed' text in the dataset I've set the properties
attributeFormDefault and elementFormDefault to unqualified in the properties
window. then with the normal code I create an sql data adapter and use the
fill method with this data adapter and strongly typed dataset. This
produces the results that I want. The problem is that as the application
grow, I'm getting a lot of datasets in the designer (not to mention that
fact that I also need to manage a naming convention to keep all of these
datasets organized). And the only think most of these dataset are used for
is to assist in generating datasets with as little text as possible for
sending across the wire. They aren't used for validation or managing data
in anyway. It would be MUCH cleaner if I could generate these attribute
based datasets on the fly with out using strongly typed datasets.
Question: is it possible to create a dataset on the fly where all the rows
are elements and all the columns are attributes and populate it using the
fill method. I would need to define the element name of the rows such as
"r", and it would be ideal if the attribute names to be automatically named
after the column names returned by the sp. Is there a way to do this with
out a lot of code? Whether there is or isn't, what's the best way to do
this?
Thanks.