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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:21:43+00:00 2026-05-13T13:21:43+00:00

I am prototyping an app using ASP.NET MVC and SQL Compact Edition on VS2008.

  • 0

I am prototyping an app using ASP.NET MVC and SQL Compact Edition on VS2008. I have 2 entities that have have a many-to-many relationship with each other. When I save objects to the database through hand-crafted SQL I need to find out what their ID is so I can drop a record into the mapping table between the two entities. The auto_increment ID field is in fact the only unique identifier for the tables. So after I’ve done my insert, how do I re-load the record and grab the newly assigned ID?

RE: Code-is-art, I am using the builtin SqlCeConnection, SqlCeCommand, and SqlCeDataReader objects from the .NET 3.5 library.

  • 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-13T13:21:44+00:00Added an answer on May 13, 2026 at 1:21 pm

    Use “SELECT @@IDENTITY” in a subsequent call to the database.

    Compact is single user access you don’t need to worry about transactions etc to protect against other inserts.

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

Sidebar

Related Questions

I'm prototyping a chart using ASP.NET Chart Controls. I have the following code to
I have got an app I'm writing and I'm currently considering using MVC to
I am prototyping a web application using Spring MVC 3.0 with JasperReports. I have
I'm busy prototyping a training management app using the DevExpress eXpressApp framework & Domain
I am prototyping a AJAX based web application running up against ASP.NET, where I
We're doing some prototyping of a new app and noticed that one of the
I am prototyping a Django web-app that will provide a static media files (PDFs,
I need prototype the UI for next gen of my ASP.Net app. I'd like
I've begun prototyping a desktop app with Tcl and intend to present the idea
Currently I'm prototyping search with Lucene.Net-2.0-004 on a web application. It's working very well,

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.