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

  • SEARCH
  • Home
  • 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 6046091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:11:55+00:00 2026-05-23T07:11:55+00:00

I will explain firstly what I do, then I will specify where is the

  • 0

I will explain firstly what I do, then I will specify where is the problem.

My application gets an XML file from an authenticated user through (file uploader), then I map (I mean migrate) the data stored in the XML file to its equivalent one in my database.
I get the data from the XML file through LINQ.

  • My first question

    Each element in
    the XML file has an equivalent entity
    in my database. What is the best and
    more performant way to insert
    more than one record in a
    specific table and guarantee that if
    there is something wrong in the data, rollback the whole operation?
    Is there some example of how to do
    this? Do you have any suggestions concerning
    validating the XML data?

  • My second question:

    In the first question, I talk about the
    the (INSERT) operation. If the
    user changes some data in the XML
    file then I want to update my
    database with the new data. How should I
    do this? Should I compare each
    record, or try to insert and, if that fails,
    then update this record?

  • 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-23T07:11:55+00:00Added an answer on May 23, 2026 at 7:11 am

    each element in the XML file has an
    equivalent entity in my database. What
    is the best and more performance way
    to insert more than one record in a
    specific table .and guarantee if there
    is some thing wrong in the data ,
    rollback the whole operation .please
    if there is some sample to do this.and
    any suggestions concerning validating
    the XML data.

    The simple answer here is: use a transaction. The point of transactions is to provide you with a mechanism whereby you can execute multiple commands, then either commit them as a single unit of work or roll them back completely so that the database is left in a state as if your operations had never taken place.

    in the first one i talk about the the
    (INSERT) operation, if the user change
    some data in the XML file then i wanna
    to update my database with the new
    data.how to o this .should i compare
    each record . or try to insert if fail
    then update this record?.

    The try-error-different retry pattern is not a desirable one if it can be easily avoided. Your SQL should either use a statement that is designed to conditionally insert or update depending on existing data (such as the SQL Server MERGE command; I don’t have Informix experience so I can’t speak to what it supports or if MERGE is ANSI SQL), or you should do this conditional logic yourself within the SQL.

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

Sidebar

Related Questions

I will explain my question from an example. In .H file// @interface Employee:NSObject{ @private
I will explain problem with an example: There is two table in my database,
I will explain how to reproduce my problem: Log into my page: session variables
First I will explain the context of the problem, because you might be able
Maybe the question is not self-explanatory, so I will explain it through. The deal
I will explain my problem(excuse my bad English), I have a .NET exe in
I am creating a C# application I will explain what I want by giving
following is the problem i am facing. i will explain it will an example
I will first explain what I'm trying to do then I will explain why
I am facing problem in big decimal no. Following code snippet will explain my

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.