471,610 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

very simple question, but i cant find the answer

Hello,

I am trying to write a generic tool that accesses a SQL server and
reads/updates/deletes/creates records. I want to reference this tool from
my asp.net pages to talk to my db. by the way, i want the results of any
read, update and create to be returned in xml.

when reading data, i populate a dataset with data and then use the
dataset.getxml method to return xml. is this a neat way of reading data?
how does it compare to the FOR XML EXPLICIT command in sql server?

when creating/updating data i was thinking of using a data adapter but this
seems a bit over the top, maybe i am wrong? should a data adapter be used
when doing bulk updates? For example, when editing a data grid there may be
many rows that have been updated, so the data adapter can be used to filter
out the rows that have changed and update the db.

For my scenario i will probably only be updating a single row at a time, so
should i just use a simple command object to build a query and update the db
like that?

i hope i have made myself clear in what i am trying to acheive and what my
concerns are. i am new to ado.net so i am just trying to find out the best
way of doing things.

many thanks.


Nov 12 '05 #1
3 1656
The 2 xml methods are not related. Calling GetXml on the dataset is just a
way to get the data in the dataset in XML form. But the data is already
there. In fact, you don't know how it got there - it could have been added
there manually, or populated from a text file.

If you have many rows that needs to be updated/inserted/deleted, a data
adapter may be the way to go. If it's just 1 row, it might be cleaner to
just construct the SQL and execute the query.

"suzy" <su**@spam.com> wrote in message
news:iu*****************@news-binary.blueyonder.co.uk...
Hello,

I am trying to write a generic tool that accesses a SQL server and
reads/updates/deletes/creates records. I want to reference this tool from
my asp.net pages to talk to my db. by the way, i want the results of any
read, update and create to be returned in xml.

when reading data, i populate a dataset with data and then use the
dataset.getxml method to return xml. is this a neat way of reading data?
how does it compare to the FOR XML EXPLICIT command in sql server?

when creating/updating data i was thinking of using a data adapter but this seems a bit over the top, maybe i am wrong? should a data adapter be used
when doing bulk updates? For example, when editing a data grid there may be many rows that have been updated, so the data adapter can be used to filter out the rows that have changed and update the db.

For my scenario i will probably only be updating a single row at a time, so should i just use a simple command object to build a query and update the db like that?

i hope i have made myself clear in what i am trying to acheive and what my
concerns are. i am new to ado.net so i am just trying to find out the best
way of doing things.

many thanks.


Nov 12 '05 #2
In regards to your question
when creating/updating data i was thinking of using a data adapter but this seems a bit over the top, maybe i am wrong? should a data adapter be used
when doing bulk updates? For example, when editing a data grid there may be many rows that have been updated, so the data adapter can be used to filter out the rows that have changed and update the db.
One thing to be careful of is that for the 1.0 and 1.1 releases of .NET, the
data adapter will take a seperate round trip for each changed row. This
might be fine for propagating the changes made to a data grid, but if you
have too many rows that have been changed you could get into trouble.

- Dave

"suzy" <su**@spam.com> wrote in message
news:iu*****************@news-binary.blueyonder.co.uk... Hello,

I am trying to write a generic tool that accesses a SQL server and
reads/updates/deletes/creates records. I want to reference this tool from
my asp.net pages to talk to my db. by the way, i want the results of any
read, update and create to be returned in xml.

when reading data, i populate a dataset with data and then use the
dataset.getxml method to return xml. is this a neat way of reading data?
how does it compare to the FOR XML EXPLICIT command in sql server?

when creating/updating data i was thinking of using a data adapter but this seems a bit over the top, maybe i am wrong? should a data adapter be used
when doing bulk updates? For example, when editing a data grid there may be many rows that have been updated, so the data adapter can be used to filter out the rows that have changed and update the db.

For my scenario i will probably only be updating a single row at a time, so should i just use a simple command object to build a query and update the db like that?

i hope i have made myself clear in what i am trying to acheive and what my
concerns are. i am new to ado.net so i am just trying to find out the best
way of doing things.

many thanks.


Nov 12 '05 #3
Aha, I never knew that. That's even more reason for me NOT to use the
dataadapter for my situation :)

"David Schleifer [MSFT]" <ds******@microsoft.com> wrote in message
news:OT**************@tk2msftngp13.phx.gbl...
In regards to your question
when creating/updating data i was thinking of using a data adapter but this
seems a bit over the top, maybe i am wrong? should a data adapter be used when doing bulk updates? For example, when editing a data grid there may be
many rows that have been updated, so the data adapter can be used to filter
out the rows that have changed and update the db.


One thing to be careful of is that for the 1.0 and 1.1 releases of .NET,

the data adapter will take a seperate round trip for each changed row. This
might be fine for propagating the changes made to a data grid, but if you
have too many rows that have been changed you could get into trouble.

- Dave

"suzy" <su**@spam.com> wrote in message
news:iu*****************@news-binary.blueyonder.co.uk...
Hello,

I am trying to write a generic tool that accesses a SQL server and
reads/updates/deletes/creates records. I want to reference this tool
from my asp.net pages to talk to my db. by the way, i want the results of any read, update and create to be returned in xml.

when reading data, i populate a dataset with data and then use the
dataset.getxml method to return xml. is this a neat way of reading data? how does it compare to the FOR XML EXPLICIT command in sql server?

when creating/updating data i was thinking of using a data adapter but

this
seems a bit over the top, maybe i am wrong? should a data adapter be used when doing bulk updates? For example, when editing a data grid there may be
many rows that have been updated, so the data adapter can be used to filter
out the rows that have changed and update the db.

For my scenario i will probably only be updating a single row at a time,

so
should i just use a simple command object to build a query and update

the db
like that?

i hope i have made myself clear in what i am trying to acheive and what

my concerns are. i am new to ado.net so i am just trying to find out the best way of doing things.

many thanks.



Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Vito DeCarlo | last post: by
50 posts views Thread by diffuser78 | last post: by
27 posts views Thread by Paulo da Silva | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
1 post views Thread by ZEDKYRIE | last post: by

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.