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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:43:07+00:00 2026-06-13T07:43:07+00:00

I want to update three fields/columns in my database table. One of them is

  • 0

I want to update three fields/columns in my database table. One of them is primary key “id”, I made it autoincrement using visual studio’s set column properties:

Identity Specification: Yes
(Is Identity)         : Yes
Identity Seed         :  1
Identity Increment    :  1

Everything going ok, but after checking for 2 times that every thing is going fine I emptied the contents of the table so that the columns can be newly populated. But first row autoincrement column got the value 3. I deleted the row and tried again but It became 4 after row was updated. I don’t know what is happening. My linq code has nothing to do with it I suppose, because its just insertion.

Code behind linq:

//DLCountryies - .dbml filename
// tblcountry - tablename
// CountryName and CountryCode are Column names
//txtCountryName - textbox

using (DLCountryiesDataContext countries = new DLCountryiesDataContext()) 
{                                                                         
            tblcountry country = new tblcountry
            {
                CountryName = txtCountryName.Text.Trim(),
                CountryCode = txtCountryCode.Text.Trim()
            };

            countries.tblcountries.InsertOnSubmit(country);
            countries.SubmitChanges();
} 
  • 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-06-13T07:43:07+00:00Added an answer on June 13, 2026 at 7:43 am

    You’re actually seeing the proper behavior for auto-increment columns. The identity value isn’t determined by using the current values in the table. SQL Server tracks identity values elsewhere.

    Those values don’t reset after deleting records. The column simply continues counting from the last value.

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

Sidebar

Related Questions

I want to update 4 Columns in a particular row in MySQL using C#
I have a table named meeting_times with fields: meeting_date_time user_id I want to update
I have a simple row that has 4 columns: { [Primary Key Int]RowID, [text]Title,
Basically I have two models: User and Godfather. The godfather table has three columns:
I want to interrupt some specific grails domain class events(read,write,delete,update).Is there any hibernate eventlistner
My requirement is that I want an object (tee) to update if there have
I want to know if there's any way to update from all versions (Example:
I want to capture a Flick touch event in Update method. In there, I
i want update textarea content onclock on a input button for example: <input type=button
What I want: Update all new commits from server with my local repository in

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.