adding records to multiple tables in MSDE 2000 from XML using ADO.NET

I am using .NET web aplication and MSDE 2000. I receive new record in
XML format which I want to add into MSDE 2000. I am doing it as below.

   Private Sub InsertNew(ByVal sData1 As String)
      Dim SR1 As System.IO.StringReader = New
System.IO.StringReader(sData1)

      DS1.ReadXml(SR1)
      SqlDataAdapter1.Update(DS1)

End Sub

This works fine with one table.

But say, I receive following XML data:
<ORDER>
      <COMPANY>DIXON</COMPANY>
      .
      .
      .
      <ITEMS>
         <ITEM>
           <NAME>SONY - 32 inch</NAME>
           <QTY>2</QTY>
         </ITEM>
         <ITEM>
           <NAME>PHILIPS - 32 inch</NAME>
           <QTY>1</QTY>
         </ITEM>
      </ITEMS>
     .
     .
     .
</ORDER>

I want to add a new record(s) in Items table for above items and
remaining data as a new record in some other table. How can I do this?

Thanks.
0
pratibhaa (4)
7/18/2003 10:56:46 AM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
640 Views

Similar Articles

[PageSpeed] 57

Please don't cross-post to multiple groups.

You would likely need to issue multiple Update commands against each
DataTable, specifying the correct InsertCommand, UpdateCommand, and
DeleteCommand for each DataTable.  Issue an update for the Items table
separately from the Update for the other table(s).


-- 
Kirk Allen Evans
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans


"PA" <pratibhaa@jvc.co.uk> wrote in message
news:f7b9f4bb.0307180256.45dc4d91@posting.google.com...
> I am using .NET web aplication and MSDE 2000. I receive new record in
> XML format which I want to add into MSDE 2000. I am doing it as below.
>
>    Private Sub InsertNew(ByVal sData1 As String)
>       Dim SR1 As System.IO.StringReader = New
> System.IO.StringReader(sData1)
>
>       DS1.ReadXml(SR1)
>       SqlDataAdapter1.Update(DS1)
>
> End Sub
>
> This works fine with one table.
>
> But say, I receive following XML data:
> <ORDER>
>       <COMPANY>DIXON</COMPANY>
>       .
>       .
>       .
>       <ITEMS>
>          <ITEM>
>            <NAME>SONY - 32 inch</NAME>
>            <QTY>2</QTY>
>          </ITEM>
>          <ITEM>
>            <NAME>PHILIPS - 32 inch</NAME>
>            <QTY>1</QTY>
>          </ITEM>
>       </ITEMS>
>      .
>      .
>      .
> </ORDER>
>
> I want to add a new record(s) in Items table for above items and
> remaining data as a new record in some other table. How can I do this?
>
> Thanks.


0
kaevans (29)
7/18/2003 2:59:19 PM
Reply:

Similar Artilces:

Adding columns automatically based on worksheets
MVPs In a workbook, I have initially 2 sheets. Sheet1 contains information about sheet2 which is reflected in Column B. How can I automatically add a column (column C, D, etc..) of information if I add another sheet3, Sheet4, etc.. Meaning, I want to be able to freely add sheet3, sheet4 and in sheet1 columns would be automatically be created based on these new sheets. ...

Backslash "\" is being added to XML Attributes, Is there a way to get rid off it?
I have not encountering this problem 'till I got VS.NET 2003. Check my xml below how the backlash is added. I tried all possible ways to replace it but nothing happens. Any help will greatly appreciated. <SESSION_INFO_ID ID=\"434674640\"> <TEL_NBR VALUE=\"2532668900\"> <PRODUCT hcid=\"1600\"></PRODUCT> <PRODUCT hcid=\"1700\"></PRODUCT> </TEL_NBR> </SESSION_INFO_ID> Pete wrote: > I have not encountering this problem 'till I got VS.NET 2003. Check my xml > belo...

Adding columns to item table
Are there any incompatibility issues I would need to worry about in adding additional columns to tables in the database? I'm already using most of the available fields in the item table and I would like a place to store each items ASIN assigned from amazon. I don't need to be able to read or write this in either the POS or the Manager, I just need to be able to access it through SQL queries. I would like to know the same thing. Has anybody done that without problems? <tfitts@gmail.com> wrote in message news:ce05743c-7ca2-49cc-89da-815d91c77e4d@1g2000prd.googlegroups.com......

multiple users send from common email address
Hello, I have several users from support department (exchange 2003). Although they have each his own email address, I would like to let them send email from a common address such as support@company.com from their outlook clients. Really, they could use the "reply to" field, but is there some simpler way? On the other hand, I would like all of them to receive messages at support@company.com address. Is it possible? many thanks in advance. O. Ondrej: To get them all to receive mail at support@yourdomain.com, just create a distribution group in Active Directory Users and Co...

Adding Palettes to V8.0
Hi, What is equivalent to Setup > Company > Palettes in V8.0. I have a 3rd Party application (cnk) and I need to access it's forms and reports Thanks There are some third party developers who have added some Palette functionality back to v8.0. However, this is not what you need. You need to look at the Great Plains Integration Guide that is provided with Dexterity and add into your chunk the commands and menus required for the navigation model used in v8.0 of Great Plains onwards. The other choice is to use Shortcuts, but this would need to be set up for Multiple users and...

table of contents
The whole tab thing just works like it's broken in Pub 2000. No matter how many times I reset the tabs for the table of contents, it goes back to mish mash when I open it.. I then have to reset each line individually because it's not smart enough to do the whole page. The last line doesn't have a chapter number so it won't stay in line with the others at the right edge. It's a real pain in the neck. After managing to set up OE-QuoteFix on his new PC, Ed reads a message from Asussertown <DROPsussertown@adelphia.net>... > The whole tab thing just works like it'...

be able to print indivually different labels on multiple label sh.
hi i want to be able to use publisher to print individual labels on a multiple label sheet, any ideas regards greg Do you mean different addresses on the labels or be able to print one label as needed and tell it which label you want to use? (I do the latter in Word.) -- JoAnn Paules MVP Microsoft [Publisher] "Greg" <Greg@discussions.microsoft.com> wrote in message news:740CB634-47E8-4EEC-BE75-768932495A30@microsoft.com... > hi > i want to be able to use publisher to print individual labels on a > multiple > label sheet, > any ideas > regards > g...

[P2007]
Hi, I have a PM user who has just changed the login account password in AD and after that he is no longer able to login to PWA, an access denied message will show up instead. Even if I assign him as an administrator, he is still getting the same problem. He has no issue using Project Professional (with his account) to connect to the project server, it is just the PWA that he is unable to access. Did anyone encountered the same issue before? Regards Godrid Godrid: Most likely his desktop is sending the incorrect credentials. Verify that the user didn't save the passw...

How do I use the connection string to connect to a table on the database that I am working on.
I have two related tables. and one form of which one of the tables is a subform and i want to write the data on the subform to a textfile. I used this code to connect to the table but because I have already opened the MDB. I get the error that the file is already openned. objConn.CursorLocation = adUseClient objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Documents and Settings\exds006\Desktop\Electronic LIV;" & "Persist Security Info=False" objConn.Open Is there another way of accessing th...

Countif using symbols
I have a worksheet that has a column containing icons, from the new options of conditional formatting, in Excel 2007 (Icon sets) I need to count how many of each icon I have. Can I do this using the function COUNTIF(). I couldn't figure out what should I use as criteria here. Thanks in advance. Regards, Emece.- ...

how to use the search dialog box ?
Hello Everybody, I have a question concerning the opening of dialogs box. I would like to open the Search Dialog Box. My stupid code is like this : Private Sub CommandButtonSearch_Click() 'ouvre la boite de dialogue Rechercher Application.Dialogs(xlDialogFormulaFind).Show End Sub With this code, the problem is that the Search Dialog box is indeed open but whatever the text to find in the worksheet, there is no result. If I stop the macro, open by hand the Search Dialog box and type the same text, it works... Can you help me to solve this problem ? Thanks a lot in advance. ...

Restarting Record Count in a Query
Hello, I have a query that returns these results for me: Badge No DepLastName DepFirstName 11111 Smith Mary 11111 Smith Joe 22222 Brown Bill 22222 Brown Mary 22222 Brown Jack I need to count the dependents that are linked to each Badge No so my results look like this Badge No Count DepLastName DepFirstName 11111 1 Smith Mary 11111 2 Smith Joe 22222 1 Brown Bill 22222 2 ...

Creating and using a Deleted folder
I am using outlook 2002 and when an item is deleted it shows as the item with a line thur it. Is there anyway to have the deleted item moved to a deleted folder. I am running outlook with 3 connections. Two I IMAP and one with MS exchange. The exchange one does have a deleted folder but the others don't Scott Adams <adamsfour@aol.com> wrote: > I am using outlook 2002 and when an item is deleted it > shows as the item with a line thur it. Is there anyway to > have the deleted item moved to a deleted folder. No. That's the way IMAP works. -- Brian Tillman ...

Word/Outlook convert content to a table when forwarding msgs
How do I prevent Word/Outlook from converting the content of a forwarded message to a table (actually, a bunch of nested tables) when I forward a message? Outlook/Word doesn't do this. Apparently the original message was already formatted this way. If you are convince that is not the case (look at the HTML source of the received message), then you'll have to provide some configuration details for us to work with and steps to reproduce. Also, does this happen to all messages or just this one? -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outloo...

using dmax
I want to find the max temperature for each day of the year over 10 years worth of data. I can do it by using a criteria where the first in the range of the criteria is the label ("Date" in this case) and under that cell is the date I want to look up (eg "Jan,3"). But it seems like I need to have 2 cells per day of the year in order to specify each day. That is, it looks like I have to do it this way: A B 1 Date 2 ="Jan,1" =dmax(H100:I465,2,A1:A2) 3 Date 4 ="Jan,2" =dmax(H100:I465,2,A3:A3) 5 ...

Using a common outlook address book on a home network
How do I configure my system so that all computers on my home office network can use the same list of contacts? Each computer has Outlook 2000. Two use Windows 2000 Professional; one uses Windows XP. Matt Arnett <anonymous@discussions.microsoft.com> wrote: > How do I configure my system so that all computers on my > home office network can use the same list of contacts? > Each computer has Outlook 2000. Two use Windows 2000 > Professional; one uses Windows XP. Create a network share, place your PST in that share, map a drive to it on the other machines and open the P...

Outlook 2000 #200
When I click on new message nothing happen but the hour glass spins. When I click on a message in my in box the hour glass also just spins. Any suggestions or help with this problem is greatly appreciated. Thanks! Will ...

Access 2000 to Access97
I am trying to convert a Access 2000 database into Access97. When I try this I receive a message saying 'The size of a field is too long'. Does anyone know how this database can be converted Thanks Paul ...

Mail icon on taskbar in Outlook 2000
A user right clicked on the mail icon on the taskbar and disabled it and wants it back. In Outlook 2003 there is an option to add it back, I didn't see anything in Outlook 2000. Does anyone know how I would do this? I am thinking a reinstall/repair might do the trick but I was thinking there might be something else. Thanks ...

Upgrade from Windows 2000 to Windows 2003 Killed OWA
I upgraded a Windows 2000 Server machine running Exchange 2003, to Windows Server 2003. Now after authenticating to OWA, "HTTP/1.0 503 Service Unavailable" is displayed in the browser. I seen this (http://support.microsoft.com/?kbid=305030 ) from another post, but have not tried the items at the bottom yet. In IIS, the VDirs, Exchweb, Exchange, EXadmin, were not using the ExchangeApplicationPool, they were using the default. Plus I had to click the create button next to application on all three. I tried and iisreset after that, but it did not help. I also made sure the se...

Opening .pub in earlier version (2002 in 2000) is it possible?
Jave file created in Publisher 2002. Can it be opened in Publisher 2000. is there any download to facilitate this. Phil No No Ask the orginator to do a Save As to a Pub 2000 file. Warning: It may lose something in the translation. "P. S." <anonymous@discussions.microsoft.com> wrote in message news:028f01c3a19d$7bfd2170$a601280a@phx.gbl... > Jave file created in Publisher 2002. Can it be opened in > Publisher 2000. is there any download to facilitate this. > > Phil ...

graph data from multiple worksheets
I have about 10 worksheets with data in them, I would like to put it all on one chart, how do I do it? I cannot fit it all in one worksheet. Produce the chart from the data from your first workshet. Go to your second worksheet, select the relevant data, copy, go to your chart, edit/ paste special, and accept the relevant option to add a new data series or add data to an existing series. Alternatively having produced your original chart, go to Source Data, and either adding data to an existing series or adding a new series will allow you to select the relevant data from whichever work...

Adjustmant To VBA using AdvancedFilter
This is a multi-part message in MIME format. ------=_NextPart_000_0124_01C35208.FC27F940 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Good evening All I am hoping that someone will be able to help with this. I have some small VBA code (shown below), which applies to the following = example of a data set: Worksheet "Invoice Record" A B C =20 1 M100 152.34 03 2 M101 100.02 NP 3 M100 250.65 02 4 M100 565.52 01 5 M102 745.87 NP 6 ...

Excel Table to Individual product list and spend
Hi, Basically I have an Excel data table and I have a Product name drop down list. I want to create a formula or macro so when a Product is selected, it would output the list of companies and their spend with the product. Below is a sample but the real spreadsheet has thousands of vendor names and spend for each product and there are probably ten product names altogether. Company Product1 Product2 Product3 Product4 Total ABC 7,009 8,000 15,009 Key 805,036 805,036 PC 56,016 57,470 568 114,054 Water 3,090 651 298,250 301,991 Total 66,115 863,157 306,818 -...

Using the Windows Installer Cleanup Utility for Office installation
Windows XP Professional, ver 2002, (9.0.6926) SP2 NTFS Office 2000 Professional SP3 Internet Explorer 7.0.5730.11 128 bit cipher strength I'm using Shenan Stanley's cleanup procedures, prepping for install of Windows XP SP3. Confirm answers regarding instructions for using the Windows Installer CleanupUtility to remove Office 2000, Office XP or Office 2003. (1) Right now, I'm running Office 2000 Professional SP3. I know Microsoft article 290301 says the Installer Cleanup Utility it is not going to remove the actual Office program; it is only going to remove ...