Deleting XML Record from Dataset removing table?

Hi All,
When I delete the last record from my dataset and then WriteXML() to the 
file; the Table itself, in the xml file, is removed.  I need to prevent the 
table structure from being deleted if there are no more records to be 
written to the XML file from the Dataset.

Any ideas here,
John. 


0
jrugo (2)
11/4/2005 5:07:23 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
607 Views

Similar Articles

[PageSpeed] 11

"John" <jrugo@patmedia.net> wrote in message news:eEDs6IW4FHA.400@TK2MSFTNGP09.phx.gbl...
> When I delete the last record from my dataset and then WriteXML() to the file; the Table itself, in the xml file, is removed.  I 
> need to prevent the table structure from being deleted

There will be no records from the empty table in the data written to the
XML instance doc, that's correct, but the table structure still exists in the
schema.  If you're taking this XML from one DataSet and reconstructing
the DataSet somewhere else, then having the schema definition present
should suffice as far as creating empty DataTables in the new DataSet.

You can include the schema in your XML by calling WriteTo( ) with the
XmlWriteMode.WriteSchema argument like this,

    // Dump tables in data set (with schema) to stdout.
    dataSet.WriteXml( Console.Out, XmlWriteMode.WriteSchema);

Were the DataSet's XML serializer to produce an empty row with
empty values in each column to persist the empty table's "structure,"
such XML in the instance document would be indistinguishable
from a real row - all of whose columns had empty string values.

While there may be kludges to arrive at a similar effect (for instance,
custom serialization/deserialization that embeds DataTable schema info
in a comment that you do on both sides), using the XML schema
definition is the best place to hold this metainformation.


Derek Harmon 


0
loresayer (274)
11/10/2005 1:38:43 AM
Reply:

Similar Artilces:

Help please
Hi I'm running outlook 2000. I have a considerable number of old emails that outlook will not let me delete, I get the message "The messaging interface has returned an unknown error, if the problem presists restart outlook". Obviously I have tried re-starting outlook but this doesn't help. I have also run the inbox repair tool which does not report any errors. Is there any way I can work on and edit the 'outlook.pst' file directly? These emails are annoying and I would like to get back to a clean listing. Any assistance is much appreciated. Cheers Jem How l...

Excel 2007 Pivot Tables
1. How can I create a Pivot Table from a text file, downloaded from a mainframe database? I have been told this could be done in previous versions of Excel. 2. If I get a new text file each day, how can I refresh the existing Pivot Table, without the necessity of recreating Thank you very much Marsh Import the Text file into Excel. -- Regards Dave Hawley www.ozgrid.com "Marsh" <Marsh@discussions.microsoft.com> wrote in message news:1C480551-AE4D-4E31-B6DC-DF527E532091@microsoft.com... > 1. How can I create a Pivot Table from a text file, downlo...

Remove SBS
(Im reposting this since I got no response in the setup-config group, im hoping for better luck in this group) I have a client with SBS 2003 but isn’t utilizing any SBS functions (don’t ask me why they have SBS… it wasn’t me). Now they have an app that (based on the vender) cant run on an SBS server. How do go about doing this? I don’t care about ripping out SBS but I need to preserve AD. What would happen if I… 1)Uninstall SBS? a)Would it remove AD (as the sbs is the only domain) or is AD not a SBS role? b)Would it become a regular Windows 2003 std server machine? 2)Do an...

Pivot Table names
I have a pivot table and after some manipulation it is giving me what I desire. One question: is it possible to get rid of all the titles that start with "Sum of" and replace it with something else? Thank you. Right-click the field heading and select Field Settings, you can change it there. If you want to change Sum of Amt say to Amt, add a space at the end, else you will get a duplicate name error. -- __________________________________ HTH Bob <john.menken@ceridian.com> wrote in message news:dd61aba2-f441-4678-ae07-a182494b7911@33g2000yqm.googlegroups.com... >I have...

deleting sent messages from OE
All of a sudden I cannot delete unwanted sent messages from my sent file.any suggestions?? This newsgroup is for support of Outlook 97, 98, 2000, 2002 & 2003 from the Office family for Intel PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4.x microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x microsoft.public.windows.inetexplorer.ie55.outlookexpress for OE 5.5x microsoft.public.windows.inetexplorer.ie6_outlookexpress for OE 6.x microsoft.public.internet.mail.mac for the Macintosh versio...

Multiple Tables into one querie
Ok here it goes bare with me. I have a 4 tables Tbl 1 (basic inform) Exihibator ID Name Etc 1001 Jennifer 18 1002 Bob 17 Table 2 Steer Table Exihibator ID Entry Number Placing in Class 1001 121 2 1001 122 5 1002 253 1 Table 3 Swine Table Exihibator ID Entry Number Placing ...

Date Selection for Pivot Table
I build some pivot tables for our laboratuary. They contains daily analysis results. I want a solution to: 1-) User can enter week number and then daily analysis for that week appears day by day on a pivot table. Example: Input: 49 Output:29/11/2004---> 05/12/2004 on pivot table and regarding data 2-) User can enter month and than daily analysis for that month appears day by day on a pivot table. Example: Input 11 Output:01/11/2004--->30/11/2004 on pivot table and regarding data Thanks a lot ...

Remove component suite
I have installed component suite recently, anyway to remove it? ...

Removing data from a series
Hello everyone, Thanks for the help on my last question, it got the job done! I now need to remove data from a series. I have created a series o numbers in a column based on messages in another column, heres a example: C1 C2 C3 1- LOAlarm 1-LOAlarm 2- LOLOAlarm 2-LOLOAlarm 3- LOLOLOAlarm 3-LOLOLOAlarm This goes on for about 2000 messages and was created by the equation C = C1&" " &C2 and now I have to reverse the operation to display onl LOAlarm and su...

Recover Deleted Items #7
When I access my Exchange mailbox through OWA and open the deleted items folder, I get an option to "Recover Deleted Items". When I access the mailbox on our local network using Outlook 2003 I can't find out where in Outlook that function exists. Secondly, is there a way to limit how large that "Recovery" pool is? Chuck <cjduchon@yahoo.com> wrote: > When I access my Exchange mailbox through OWA and open the deleted > items folder, I get an option to "Recover Deleted Items". > > When I access the mailbox on our local network using Ou...

Remove "Bin not found" line from Picking Ticket
After converted from GP7.5 to GP 8.0, I found that the system using a new picking list form called "SOP Blank Picking Ticket Order Entered" which is totally different than the one "SOP Blank Picking Ticket" I used at version 7.5. During printing, I have "Bin not found" message printed at the following line of each inventory item. How can I get rid of this additional line. We do not assign the bin to each item. I tried to remove the "SOP Blank Picking Ticket Order Entered" from Modified report list and import the form I used at 7.5 but "SOP...

update /delete external refs
I have written a macro and want to se it on older workbooks.This requires that a new page replaces an existing page.However all the references come over with the new page.I want to use edit/find replace all to replace [JUL02]Frame!C$6 with Frame!C$6 ie delete all references to original worksheet.(or some other way!) I have figured it out!.I copy the new page over to the old worksheet and then change source of links back to itself! >-----Original Message----- >I have written a macro and want to se it on older >workbooks.This requires that a new page replaces an >existing pa...

Spell checking current record
I have added a spell check to a database using DoCmd.RunCommand acCmdSpelling Which works, I just want it to spell check the current record, not the whole database. Is that possible? "jamccarley" <jamccarley@discussions.microsoft.com> wrote in message news:D0ED2E35-3346-41D9-939D-56F9F345C309@microsoft.com... >I have added a spell check to a database using > > DoCmd.RunCommand acCmdSpelling > > Which works, I just want it to spell check the current record, not the > whole > database. Is that possible? IIRC, if you select the record...

saving new record in subform
The main form is frmCustomers, with a subform subfrmContacts. The subform has custom navigation buttons, cmdAddContact and cmdDeleteContact. On the subform, AllowAdditions = false. When the user clicks cmdAddContact, I set AllowAdditions = true. On the AfterInsert Event, I set the AllowAdditions back to false. If the user clicks cmdAddContact, then types in the info, then clicks cmdAddContact again, it says, "can't go to the specified record." If I click outside the subform, then back in the subform, I can add a record. I need a better solution! Thank you, Steve S...

Getting form expression results to update to table.
The totals from the expressions in a couple fields on the form don't update to the table. They (the expressions) work correctly in the form, but they (the results of the expressions) don't appear on the table after clicking Update All. Does anyone know how ot fix this? Hi Peg, First, forms don't contain fields. They contain controls (most commonly textboxes) which may or may not be bound to fields in the form's recordsource. If they are bound to a field, changing the data in the form will change the underlying field in a table (unless the form's recordsource ha...

digital voice recorder w/software
From: "ept" <ept@prodigy.net> Subject: Looking for a digital voice recorder w/software: Date: Wednesday, February 25, 2004 6:52 PM Looking for digital voicce recorder w/software that would go straight to outlook 2000 task list or a folder in outlook. Thanks in advance Pat Tichenor ...

XML Dataset editor
Hi, I am making a flash card type program for the PocketPC. I am using a dataset to contain the cards, all of that works great. I thought I would just import the XML into word or excel, copy/paste the data from other sources or add new records, and then save it as xml. As i have Office XP, that does not work. Is there a freeware XML dataset editor out there? I've found many editors, but I just need something simple - oriented towards a dataset with a couple of tables. Making something like this would not be that hard, but would sort of be re-inventing the wheel. Any suggestions? th...

Deleting e-mails on mailserver from Outlook2000 using POP3
Deleting e-mails on mailserver from Outlook2000 using POP3 I am using outlook2000 with pop3 account. I have configured pop3 to keep messages on server because I access same e-mail account from different computer . However, I've noticed when e-mail is deleted from an Inbox, deletion does not affect server's e-mail, leaving the e-mail undeleted. This results in deleted mail being downloaded when I am using a different computer. How can I do this so only undeleted e-mails are kept on server side when using pop3 protocol? Sorry, there isn't IMAP protocol being supported and no plan to...

unwanted fields to be removed
Our's is a service based company so we do not need shipping address in MS CRM. 1) Is there a restrction in MS crm 1.2 to delete custom fields? 2)Can we delete/ modify MS created fields? Considering the SQL 8000 byte limit how can this be done. 3) Can we delete it using enterprise Manager in SQL? 4) How can Dependencies be removed? Please advise suitable method for removing unwanted fields without effecting other things? Fields cannot be deleted from the schema (custom or otherwise), but can be removed from forms as long as any dependencies are removed. No, don't delete field...

Advice on changing table indexes
Hello, Our Dynamics GP 10 database has been growing an growing. We've started archiving the data using Company Data Archive, but a big part of the problem still seems to stem from the built-in indexing on a couple of our largest tables: BM30400 - Item Serial/lot history for Inventory Assembly Rows: 92 Million, Data: 17.5 GB, Indexes: 34 GB IV30101 - Item Serial/lot history for Sales Rows: 45 Million, Data: 4 GB, Indexes: 7 GB Are there any DBA gurus out there who can suggest which of the default indexes are worth removing or re-configuring? I'm looking to improve the write ...

Help locating a just deleted document
I just accidentially deleted a most important document (befor saving).. There has to be a way of reclaiming it. Anyone know how? I would be more than grateful. I thank you in advance! DW If you never saved it, there is nothing to "reclaim." -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "donwinters" <donwinters@discussions.microsoft.com> wrote in message news:836C5B40-2D6F-46A2-95BF-27FE06299656@microsoft.com... >I just accidentially deleted a most important document (befor saving).. ...

Problems deleting from the DELETE ITEMS & JUNK MAIL folders
Hi, Cannot delete certain messages from the DELETE ITEMS & JUNK MAIL folders. Why is that and how can I overcome this please? -- Kind regards, ColUCol How to Remove a Stuck Undeletable Message in Windows Mail http://www.vistax64.com/tutorials/62560-windows-mail-problems.html WMUtil http://www.oehelp.com/WMUtil/Default.aspx -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "colucol" <colucol@discussions.microsoft.com> wrote in message news:871EFF7F-09F0-485A-9CD7-71330D792E1E@microsoft.com... > Hi, > > Can...

Retrive deleted account and folders (exchange)
I have deleted the ms exchange account from outlook 2002 (XP), and that function deleted also all of may inbox,sent,... folders. Is there a option to retrive all the deleted folders?=???? brgds, jan If you were storing all your data in the Exchange mailbox, just add the Exchange account back into Outlook. jan wrote: > I have deleted the ms exchange account from outlook 2002 > (XP), and that function deleted also all of may > inbox,sent,... folders. Is there a option to retrive all > the deleted folders?=???? > > brgds, jan ...

Finding relationships between tables
All, How do I locate the relationships between tables in CRM. I am trying to relate the Incident table with the Incident Resolutions Activity table. Thank You, Barry You need to open the CRM SDK and look at the Reference-Shcemas section "Barry" wrote: > All, > How do I locate the relationships between tables in CRM. > I am trying to relate the Incident table with the > Incident Resolutions Activity table. > > Thank You, > Barry > In SQL Server Enteprise Manager you can also create diagrams to show links between the various tables -- John O'Donne...

policy removal
i am running exchange 2003 and exchange 5.5 in a mixed environment. i am working on removing the exchange 5.5 from the organization. please can anyone tell me what might happen if i delete the recipient policy that holds both the exchange 5.5 and exchange 2003 together to creat a new recipient policy after the exchange 5.5 has been removed. Please i need help with this issue. Mikeolo ...