Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 266199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:50:07+00:00 2026-05-11T22:50:07+00:00

In datasets there was a method WriteXml or ReadXml Does anyone have any idea

  • 0

In datasets there was a method WriteXml or ReadXml

Does anyone have any idea on how to this with Entity Framework?
Has anyone implemented this before?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:50:07+00:00Added an answer on May 11, 2026 at 10:50 pm

    Well basically I wanna have a back up of my database in XML, and I don’t want this backup to be handled from the server but from the application.

    I think I will handle the event that is fired in the context and then save my data.

    As I expext the xml file size not to grow too match (will hold like 100-300 small entity records of simple short data types), I decided to work synchronously against the XML DB:

    Here is the partial class of the strongly typed dta set:

    Imports System.Xml
    Partial NotInheritable Class XmlDatabas : Inherits Data.DataSet
        Private ReadOnly XmlFileName As String = _
                My.Application.Info.DirectoryPath & "\Data.xml"
    
        Private Sub SeawaveData_Initialized(sender As Object, e EventArgs) _
                    Handles Me.Initialized
            If Not IO.File.Exists(XmlFileName) Then WriteXml(XmlFileName)
            ReadXml()
        End Sub
    
        Public Shadows Sub AcceptChanges()
            MyBase.AcceptChanges()
            WriteXml()
        End Sub
    
        Public Overloads Sub ReadXml()
            ReadXml(XmlFileName)
        End Sub
    

    BTW, If you bother your self so I even made a quick perfoance test just to get an indication (don’t rely, it’s a very abstract test, test again if you ever intend to create an XmlDb of larger files!).
    consider also that this file doesn’t test the xml file for external changes, can be good for a win application, in ASP.NET or when you want to allow multi requests, consider a way to implement checking on changes for the existing application, or making a DAL DLL that has a queue of committing changes.

    Module Program
        Sub Main()
            Using ds As New XmlDb
                Dim longString = ""
                For index As Integer = 1 To 250
                    longString &= "aaaaaaaaaaaaaaaaaaaaaaaaa"
                Next
                Dim step1 = Now
                For index As Integer = 1 To Short.MaxValue
                   ds.Account.AddAccountRow(index.ToString, longString, True, True, _
                        longString, "", "", longString, longString, longString, _
                        longString, longString, longString, longString, longString, _
                        longString)
                Next
                Dim step2 = Now
                ds.AcceptChanges()
                Dim step3 = Now
                Console.WriteLine("step 1 took: {0:T}", step2 - step1)
                Console.WriteLine("step 2 took: {0:T}", step3 - step2)
                Console.WriteLine("entire operation took: {0:T}", step3 - step1)
            End Using
            Stop
        End Sub
    End Module
        Public Overloads Sub WriteXml()
            WriteXml(XmlFileName)
        End Sub
    End Class
    
    Results:
    step 1 took: 00:00:01.3390000
    step 2 took: 00:00:23.5280000
    entire operation took: 00:00:24.8670000
    

    24.8 seconds, big ah?
    wanna hear how big is the xml file? 2062857146 bytes which is 1967.2938785553 MB

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 211k
  • Answers 211k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For sure it it unwise to run all tests, because… May 12, 2026 at 10:15 pm
  • Editorial Team
    Editorial Team added an answer The format of the SQL it generates is partly dependent… May 12, 2026 at 10:15 pm
  • Editorial Team
    Editorial Team added an answer What is serviceMatchingCallback? Judging by the error, it seems to… May 12, 2026 at 10:15 pm

Related Questions

I have a C# application that calls a stored procedure that produces an xml
Here's a quick question I've been banging my head against today. I'm trying to
Under what circumstances can code wrapped in a System.Transactions.TransactionScope still commit, even though an
Can anyone suggest best method for what I want to accomplish? I have an

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.