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 7505193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:49:24+00:00 2026-05-29T21:49:24+00:00

I have an order entry system in Silverlight. I have two tables – Orders

  • 0

I have an order entry system in Silverlight. I have two tables – Orders and OrderItems. The OrderNo field in Orders table is autoincrement, but the OrderNo field in the OrderItems table is not.

What I need is whenever customer submits an order, the orderitem table’s orderno should also be filled with the orders table orderno.

What I do at the moment is add a new record to the orders table and get the incremented value and use it for the orderitem records. but, I dont want to do that way, I need these values to be generated simultaneously when the order table is updated.

  • 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-29T21:49:27+00:00Added an answer on May 29, 2026 at 9:49 pm

    Wrap your insert statements in a transaction. You will still use the same logic that you already have (updating the tables separetly), but since you are wrapping them in the same transaction, it will be an atomic operation from the database standpoint. So, if something goes wrong and you have to rollback, it will roll back both inserts, and no one will be able to observe the insert into Order until the whole transaction is committed.

    EDIT

    If you are already using Entity Framework, then it’s a transaction scope that you want. And while you are at it, I would advise that you take a really serious look at WCF RIA Services for Silverlight. It’s really a very good framework for database services.

    2nd Edit
    Here’s a video on RIA Services: http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/MID311

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

Sidebar

Related Questions

I have two tables orders and orderdetails table orders (PK = id, UNIQUE index
I have an online order entry system in silverlight. I need to send an
Lets say I have data in two tables. In one I have Order ID
Let's say I have an Order table which has a FirstSalesPersonId field and a
I'm putting together a system to track customer orders. Each order will have three
We have a low latency trading system (feed handlers, analytics, order entry) written in
How can I get a list of the order of tables? I have two
I have an order entry system which was developed using vb.net it uses an
I have next tables Order , Transaction , Payment . Class Order has some
So I have this application in ASP MVC 3. My database has two tables:

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.