473,545 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1713
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.co m> wrote in message
news:iu******** *********@news-binary.blueyond er.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.co m> wrote in message
news:iu******** *********@news-binary.blueyond er.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******@micro soft.com> wrote in message
news:OT******** ******@tk2msftn gp13.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.co m> wrote in message
news:iu******** *********@news-binary.blueyond er.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
958
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 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...
9
10490
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 it as I'll be checking this post very often. PROBLEM: Occaisionally, our web server begins running ASP.NET pages extremely slowly. Other...
50
5665
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
1425
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 Edition. I have a 19" LCD monitor with the resolution set at 1280 by 1024. I want to create a graphics program, say, displaying fractals that will run...
6
4323
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 the SQL I would run if it were valid syntax, but it's not: Select COLOR1, COLOR2, distinct DESC from COLORS; TABLE COLORS
2
4197
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 file (which I can provide if necessary). I use 'Add new Item' and pick 'DataSet'. I believe this creates a TypedDataSet, CORRECT? I take all the...
0
1036
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 for the controls in the .ascx. I think this is a simple matter of registering something somewhere or importing a namsepace but cant find appropriate...
27
2813
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:
5
1748
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 am looking for how to get an IF statement to give me the correct output. I am trying to get it to give me a result for a weeks pay, taking that the...
0
7473
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7408
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7815
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7433
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5976
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5340
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
712
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.