473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 15 '05 #1
3 957
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 15 '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 15 '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 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: suzy | last post by:
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...
9
by: Vito DeCarlo | last post by:
I've been having this problem for a few weeks. PLEASE read this post before responding with some simple reason that has nothing to do with my problem. If you need more information, please request...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
4
by: pcnerd | last post by:
I originally asked this question in the "classic" VB forum. It occured to me after I had sent it that I sent it to the wrong forum. Anyway! Here's the situation. I have VB.NET 2005 Express...
6
by: issac | last post by:
Hi folks Im trying to do a simple query involving the distinct keyword and an access 2000 db, but have been frittering with it for amost and hour and a half and I cant make it work. This is...
2
by: dave | last post by:
Hi, I have searched for the answer for this error message without success. I have seen the question many times though:) I create an ASP.NET project (VS 2005, C#), and use a very simple .mdf...
0
by: DanWeaver | last post by:
cant find answer to this and spent 2 hours looking including in this newsgroup! I have a web user control in my project (.ascx) the associated (vb) code (.ascx.vb) doesnt provide intellisense...
27
by: Paulo da Silva | last post by:
Hi! I was told in this NG that string is obsolet. I should use str methods. So, how do I join a list of strings delimited by a given char, let's say ','? Old way:
1
by: elsa | last post by:
hi everyone, i have a question that i cant answer..the qustion has 4 parts...i answered the first 2 parts but i cant answer the other two..here it is: Assume that we have a link with bandwidth...
5
by: Ibys | last post by:
Hi, i am just starting to learn javascript, so i am probably doing something very simple wrong. i have read a lot of articles on maths in java, but cant find anything simple enough for my problem. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.