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.






0
suzy1969 (14)
3/4/2004 1:49:50 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
534 Views

Similar Articles

[PageSpeed] 2

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" <suzy@spam.com> wrote in message
news:iuG1c.7728$Kc6.6158@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.
>
>
>
>
>
>


0
someone528 (62)
3/4/2004 5:06:58 PM
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" <suzy@spam.com> wrote in message
news:iuG1c.7728$Kc6.6158@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.
>
>
>
>
>
>


0
dschleif (1)
3/5/2004 1:22:15 AM
Aha, I never knew that.  That's even more reason for me NOT to use the
dataadapter for my situation :)

"David Schleifer [MSFT]" <dschleif@microsoft.com> wrote in message
news:OTvXMBlAEHA.3400@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" <suzy@spam.com> wrote in message
> news:iuG1c.7728$Kc6.6158@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.
> >
> >
> >
> >
> >
> >
>
>


0
suzy1969 (14)
3/5/2004 11:34:16 AM
Reply:

Similar Artilces:

Question Ragarding migration
Hello All: Having some issues with migration from 5.5 to 2000. Have 2000 exchange server setup in a different org than that of the 5.5. Both in DNS with mx records and priority 10 Have ADC installed and 2 way connection agreement between the 2 - constant replication. Can migrate the mailbox over to the 2000 server no problem with the migration wizard. However, first issue is that after the migration has completed, the mailbox is left in place on the 5.5 server. I thought it would delete it Second issue is that if I leave the mailbox intact, it receives mail on the 5.5 server. If I delete i...

If any cell in a range is blank question
Hello. I have two sheets in a workbook. One is a Summary sheet, and the next is titled "Bldg 5". What I am trying to make sure is that the range A1:K20 on the Bldg 5 sheet has had data entered to them (ie, they are not blank). The question that corresponds to Summary sheet A1 is "Has the data for Bldg 5 been updated?" If ANY blank in Bldg 5's range A1: K20, then put a "NO" in Summary A1's cell. If ALL of the Bldg 5 range had data in it, then put a "YES" in Summary A1. I also need A1 to update as data is entered into the Bldg 5 range (a...

pswd question
On XP pro sp3, if I start->run and type control userpasswords2 then hit enter I get a UserAccts window, I then click the Advanced Tab, I then go down to the center of the window to the AdvancedUserManagement heading and then look to the right and click the Advanced button, I get another window called LocalUsersAndGroups, if I then click Users->MyAcctName I finally get a window that called MyAcctName Properties, if I look down to the center I see a check box (that is checked) beside a heading that says, "password never expires". Ok.......now I go to ControlPanel(ClassicV...

Pivot Table question #4
Hi I have spreadsheets that take data via a pivot table from an OLAP cube that is held on a terminal server. The spreadsheets hold figures entered by me and figures obtain from the pivot table. I want to enable the automatic update on the pivot table but the pivot table is sorted by a project number obtained from the OLAP cube. My problem is if a new project is added to the OLAP cube then it is automatically selected from the drop down list. I want to be able to turn this off so that it only selects the project I have previously chosed. For example if I have selected the filter nu...

Remote Server Question
Right customer wants to acces his win2k8 server remotely. IT is using a generic printer from the server. At the office the printer is on a network. Terminal Services are being used to access the server remotely. What needs to be done to get said printer working? -- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee UK Time for a Common Sense change vote Liberal Democrat / Alliance Whether "at the o...

x-y Line Graph question
I have a line graph. X is dates and Y is numeric data. I am plotting 12/1/2005 through 1/30/2006. The problems is my series does not start at the "left most" point of 12/1/2005, it is shifted slightly. And the line does not end at the "right most" point of 1/30/2006. Any ideas will be appreciated. thanks! XL has two distinct chart types even though they look similar, the XY Scatter chart and the Line chart. There is no XY Line graph. I believe you have a Line graph. Double-click the x-axis and from the Scale tab uncheck the 'Value (Y) axis crosses betwe...

AD Computer object question
Hello, I have computer object within Active Directory for a specific server. Due to an issue, the link between the two has been broken. Is there any way to recreate the link without delete the AD object and join back the server into the domain? Thanks for your help, It's a really urgent matter, please help Dark Hello darkbol, Which kind of machine is it, Domain controller or member server or workstation? What is the exact error message? Did something happened before or is it just out of the blue? Best regards Meinolf Weber Disclaimer: This posting is pro...

GP Extender Tables Question (GP9)
I have created an Extender window with 3 Fields (let’s just say price 1, price 2, price 3). I can see where it got created in table EXT40100, field User_Defined_Prompts_1 etc and I can also see where the data is stored in EXT00103. What I don’t see is where the prompts from EXT40100 are in its own rows so that you can link them to EXT00103 for reporting purposes. I know I can hard code the flags to their proper values in Crystal or set up my own custom table to do it but I would have thought that Extender will have a table like that. Am I just not seeing it? -- Pieter The prompts ...

Question on Formats...
This ought to be quite simple to answer. Is it possible to format the contents of a combobox? On sheet1 I have text in cells A1 to A8 e.g A1 = John, A2 = Steve, A3 = Claire etc. I have a combobox on a chart that displays those names when I click the down arrow. The default is lower case, black lettering. Can I make the names appear in bold and green for example? I have tried modifying the original names but that makes no difference. If I right click the combobox and select <Format Control> I cannot see a way to format my data entries. Maybe you can't do it. And I want to ...

Chart
Hello, I created a line column chart on 2 axis. I have four data sets. The first 3 should go on the primary Y axis as columns and the 4th should go on the secondary Y axis as a line. However, Excel wants to automatically put both the 3rd and 4th data sets on the secondary axis as lines. I cannot find any command to change the 3rd data set to go onto the primary axis as a column. Any suggestions would be most appreciated! -Patty On Tue, 11 Nov 2003 13:27:33 -0800, Patty = <anonymous@discussions.microsoft.com> wrote: > Hello, > > I created a line column chart on 2 ...

[more of a 'c' question really] Converting doubles to strings without getting scientific notation
Hello hello.. I'm using _gcvt in a dialog to display a double, but when it gets small the string appears in scientific notation ie 0.02 become 2e-02 Is there another conversion routine I can use to prevent this? I have a not terribly scientific customer who would prefer a straight forward decimal display. Thanks "Zardoz" <thing@thing.thing> wrote in message news:122lvvkvicks85nka58iugok64ba0plpem@4ax.com... > Hello hello.. > > > I'm using _gcvt in a dialog to display a double, but when it gets > small the string appears in scientific notation ...

CRM v3.0 Questions
Hello, Is the fuctionality to unshare multiple records available in v3.0. The 1.2 documentation shows this functionality but it seems to be missing from the actual product. When you re-assign a record in v1.2 the record maintains a share relationship with the prior owner. Does v3.0 function the same way. Are there any tricks (other than using SCRIBE) when importing new records to link multiple contacts to a single lead. Has any new flexibilty been added to the Microsoft record importer. Thanks, Ron In 3.0 if you go to the settings > Organization Settings > System Settings th...

OL 2003; Question about two default attachments in HTMLMessage Format
This is a multi-part message in MIME format. ------=_NextPart_000_000F_01C51E85.7F26CCA0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0010_01C51E85.7F26CCA0" ------=_NextPart_001_0010_01C51E85.7F26CCA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Outlook 2003, XPP SP2=20 Hello, When I send an e-mail message in HTML message format, the recipient = (even when I send to myself) also receives two default attachments, = image001.png and image002.png. The first image is a what I would guess a = Microsoft ...

Rounding Up question
Hi, A1 has the ROUNDUP Function referenced to B1: ROUNDUP(B1,0). Example: B1 says: 6.2 A1 will roundup to 7. Perfect! This works 99% of the time. But in a special case B1 says 6.0 - A1 still rounds up to 7. I expanded B1 decimal places and found B1 in this case really says: 6.00044. Hence the reason for A1 rounding to 7. Is there anyway to tell the A1 ROUNDUP function to not round up when the first decimal place says zero? Or to only go out one decimal place when rounding up? Hope I worded my question that it can be understood. Thanx in advance, Amy. Hel...

Macro: Find matching DATA, copy correspondently values into another list
Okey guys - please advise me on this. (There was unfortunately no quick response to my latest problem - and I begun to swim... However - that brought me out on deep VBA-water...again - and now need a life buoy (metaphorical spoken)). The core of my macro problem is to look for all the values in column A (Range A5:A??) in Sheet "BOARD" (not bored!!!) that match values in another list placed in column A in sheet "LIST". When finding the match I will copy correspondent celle.value in column D / sheet "BOARD" into column B in sheet "LIST" - this w...

List of questions
Hi, I have some questions in outlook 2003, can anyone help me? 1-how can i in the appointment type a subject with special format (red, bold..) 2-whent a task is 100% completed, how can be deleted automatically. 3- I need to filter only the available time on a specific day. ex if i have 2 appointments today on a specific time, what i need to see is the available time for other new appointments. 4-If I have a lot of appointments on a specific date that are colored with labels and have a specific show time as (busy,tentative), when i go to print this calendar with the "calendar detai...

Treeview Control Question
Hello, I am using a treeview Control in a form that has a tab control. The treeview control is located on one of the tabs. When the form loads it populates the treeview control(has checkboxes enabled on treeview), bolds certain text based on the SQL table it's pulling from, and then checks any items that were checked last time the record was saved. The problem that I am having is that when I move to another tab and go back to it, all of the bolds and checks are gone. I've tried redoing the query on tab control and page click actions as well as trying to set focus on the treeview ...

How to Find Record if Exists, Add if not?
How to Find Record if Exists, Add if not? I have a form where user will enter the vendor ID, which is a unique ID. They enter it off a long list of information listing many vendors and it's hard to know if the vendorID already exists in the database, until they tab through all the fields and get the duplicate record error. Then they press Esc and do a search on that vendorID to pull up the existing record to update. VendorID format is similar to this A123456789ST (Usees a prefix, Vendor FEIN, State abbrev.) I want to automate this. when they enter the VendorID, I want it to s...

Finding data
Hi all, first post here at these forums :) I have a question/ problem that hopefully someone can answer for me. If anyone has the time, could they have a look at the attachment, i was easier that trying to explain it. But in a nutshell it involve finding data within sheets and totaling them on another sheet. The problem is that in my real world example, I will have 40 sheets and 100 rows of data, so performing it manually is out of th question. cheers, and thanks for your time. Charli +------------------------------------------------------------------- |Filename: help1.zip ...

ADO Find method
I would like to know if there is a way to use the ADO Find method to find one of several values for a single column. See the following example: rstOpenJobProcess.Find "[proc#] = '940' or '941'" I would like to search for proc# '940' or '941'. I want to avoid using a like statement in the criteria (such as [proc#] Like '94*') because I may use '942' for something else in the future that I would not want to search for. Is there a way to use the Find method in this way? Alternatively, is there a clever workaround? Th...

Easy formula question
=IF(D4>D5:D6:D7:D8:D9:D10:D11:D12:D13:D14:D15:D16,"Leader","---") :confused: I am trying to get a cell to say the word Leader if cell D4 is greate than the other cells in the list or if D4 is not greater than the cell in the list to say --- but obviously I have the formula above wron because it is not working. Help ASAP please!!!! Thanks in advance for any help with this, Mik -- mikeee ----------------------------------------------------------------------- mikeeee's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1461 View this thread: htt...

Question about MFC source code.
Hi, all, I find that there are some redefinitions in afxHH.h. Something looks like this: #define HID_FILE_MRU_FILE1 0x1E110 #define HID_FILE_MRU_FILE1 0x1E111 // aliases: MRU_2 - MRU_16 #define HID_FILE_MRU_FILE1 0x1E112 #define HID_FILE_MRU_FILE1 0x1E113 #define HID_FILE_MRU_FILE1 0x1E114 #define HID_FILE_MRU_FILE1 0x1E115 #define HID_FILE_MRU_FILE1 0x1E116 #define HID_FILE_MRU_FILE1 0x1E117 #define HID_FILE_MRU_FIL...

Get the answers! (Dutch)
http://www.microsoft.com/netherlands/msdn/events/SDC2005.aspx ...

Advanced find and seeing full path to mail
When doing an advanced find Outlook only show the sub- folder it is in. How do you get it to list the full path. Listing a sub-folder can be very hard if there are folders with the same name. This is with Outlook 2000. ...

Excel question 12-29-09
I am working with a spreadsheet created by someone else. I cannot view rows 1-6 on the sheet, but they appear when I do a print preview. How do I make these rows appear? Maybe they are hidden. Select all cells (click on the top left corner of the sheet), Formats>Row>Unhide -- Regards! Stefi „racefan” ezt írta: > I am working with a spreadsheet created by someone else. I cannot view rows > 1-6 on the sheet, but they appear when I do a print preview. How do I make > these rows appear? Racefan, It appears as if there are two things going on here...