473,405 Members | 2,171 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,405 software developers and data experts.

Dataset WriteXML method

My apologies if this has appeared twice. I have had trouble hitting
this server. Anyway...

I have a .NET windows app that uses a small XML support file. I use
it in a recordset and the WriteXML method keeps it current. My
problem is getting a particular value to write

In the code below the txtBase.Text value is filled from the FileName
property of an OpenFileDialog object. This value will never write to
the XML. If, however, I merely type something into this text box
instead of getting it from the OpenFileDialog, (or even hardcode some
string value in the code), this method updates the XML with no
problem.

Anyone have any ideas of how to fix this??

Here's the code (dsSettings was filled earlier with the ReadXML
method)

Dim rwSystem As DataRow = dsSettings.Tables(0).Rows(0)

rwSystem("BaseDirectory") = txtBase.Text
dsSettings.AcceptChanges()
dsSettings.WriteXml("ProgramSettings.xml"
XmlWriteMode.WriteSchema)
Nov 20 '05 #1
1 3892
OpenFileDialog will change your application default directory. Most
likely the valud has been written to another place. Set FileDialog's
RestoreDirectory property to be true will solve the problem.

Thomas <Thomas> wrote in message news:<hn********************************@4ax.com>. ..
My apologies if this has appeared twice. I have had trouble hitting
this server. Anyway...

I have a .NET windows app that uses a small XML support file. I use
it in a recordset and the WriteXML method keeps it current. My
problem is getting a particular value to write

In the code below the txtBase.Text value is filled from the FileName
property of an OpenFileDialog object. This value will never write to
the XML. If, however, I merely type something into this text box
instead of getting it from the OpenFileDialog, (or even hardcode some
string value in the code), this method updates the XML with no
problem.

Anyone have any ideas of how to fix this??

Here's the code (dsSettings was filled earlier with the ReadXML
method)

Dim rwSystem As DataRow = dsSettings.Tables(0).Rows(0)

rwSystem("BaseDirectory") = txtBase.Text
dsSettings.AcceptChanges()
dsSettings.WriteXml("ProgramSettings.xml"
XmlWriteMode.WriteSchema)

Nov 20 '05 #2

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

Similar topics

4
by: Simon | last post by:
Hi all, I have a process, where I take a dataset from an SQL call, and need to write an XML file from that dataset. The data set can contain 10's of tables, each with 100's of rows, and I have...
1
by: Wil | last post by:
I'm very new to developing in .NET and even newer to XML. The past few days have been pretty frustrating for me because I'm trying to perform a transform on data in a dataset and it's not working....
3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
2
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
3
by: Joe98765 | last post by:
I have data coming from SQL Server and need to write out some XML. I have a schema(xsd) for this XML file. Right now I am bringing in the DataSet and writing out the elements and attributes myself...
4
by: Pipo | last post by:
Hi, I fill myDataset from a Excel file. Then I do a myDataset.WriteXML("C:\MyXML.xml") So far everything goes as I want to. But I need a attribute when a node has a value e.g.: I get:
1
by: RS | last post by:
I have a dataset that was created from a XSD schema. I populate it with data and use WriteXml method to create XML document. Problem is XML tags come out in the order that is different from the...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
2
by: David Richards | last post by:
Hi, I was wondering if anyone could help me. I have DataSet that contains the following data tables Customers, Calls, Quotes, QuoteDetails, Competitors, Contacts, Notes, and I have setup...
4
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a DataSet that I save as XML using the DataSet DataTable's WriteXml method. If I say XmlWriteMode.IgnoreSchema, it shows up great in Excel, but I can not reopen the file in my...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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,...
0
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...

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.