Results 1 to 4 of 4

Thread: Working with XML and DataSet

  1. #1
    Join Date
    Apr 2009
    Posts
    89

    Working with XML and DataSet

    Hello,

    I have big database but from that i will select only few tables,few line with few users and will choose XML as data storage.

    Until now I used to make a ReadXml () and WriteXml () from the DataSet, but now I want to manage concurrency.

    Will it be possible to manage the concurrency in this case and if yes then How?

    If i do certain specific changes to achieve that then will be able to change only the XML nodes that have been modified. In fact I do not adapt at all which allows operations update on Xml.

    Similarly, I wish I could run a query on my file that I return a DataSet.

    In advance thank you.

  2. #2
    Join Date
    Feb 2009
    Posts
    40

    Re: Working with XML and DataSet

    I will recommend to use the dataset as it is collection of in-memory cached data ,So it's good to use datasets when:

    • we will be working with multiple separated tables or tables from different data sources.
    • when we are exchanging data with another application such as a Web Service.
    • we perform extensive processing with the records in the database. If you use a SQL query every time you need to change something, processing each record may result in connection being held open which may affect performance.
    • when you wanted to perform XML/XSLT operations on the data.

  3. #3
    Join Date
    Dec 2008
    Posts
    202

    Re: Working with XML and DataSet

    Here I will explain about in what and how the methods would be declared:

    WriteXml Method

    This method writes the XML representation of the data in the DataSet object to a TextWriter object, an XmlWriter object, a Stream object or directly to a specified disk file. The syntax of overloaded versions of this method is below.

    public void WriteXml(string);
    public void WriteXml(TextWriter);
    public void WriteXml(Stream);
    public void WriteXml(XmlWriter);

    This XML representation can either include or omit the corresponding XML schema.

    ReadXml Method

    This method reads the XML data (including a schema when present) into the DataSet from a TextReader, XmlReader, Stream object or directly to a specified disk file. The syntax of overloaded versions of this method is below.

    public void ReadXml(string);
    public void ReadXml(TextReader);
    public void ReadXml(Stream);
    public void ReadXml(XmlReader);

  4. #4
    Join Date
    Jan 2009
    Posts
    99

    Re: Working with XML and DataSet

    To manage the competition process 2, generally using Mutex: Before you access the file, the process of attempting to acquire the mutex, and pay when hit has finished his treatment on the file. If another process B has already taken the mutex, A remains blocked until B releases.

    Otherwise, you could have a WCF service which would only have access to the file, and therefore customers will access the service immediately, so the service can simply manage the competition between its various threads with block lock.

Similar Threads

  1. Dataset vs DataReader in .Net
    By Vireshh in forum Software Development
    Replies: 3
    Last Post: 07-05-2011, 11:32 AM
  2. How to create a new DataSet
    By Leonard in forum Windows Software
    Replies: 5
    Last Post: 23-03-2010, 08:52 AM
  3. Feed a dataSet from a SqlDataReader
    By Layton in forum Software Development
    Replies: 5
    Last Post: 23-01-2010, 10:25 AM
  4. How to use dataset in ASP.Net?
    By Roxy_jacob in forum Software Development
    Replies: 3
    Last Post: 28-11-2009, 06:13 PM
  5. How is DataSet.xsd used in any particular website
    By Guns-n-Roses in forum Software Development
    Replies: 3
    Last Post: 25-09-2009, 12:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,254,803.39104 seconds with 16 queries