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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:37:22+00:00 2026-05-20T04:37:22+00:00

I am successfully querying data in a Sql Server CE database using the TableDirect

  • 0

I am successfully “querying” data in a Sql Server CE database using the TableDirect CommandType thanks to a tip from ctacke. (The performance increase is very real.) I am able to query using Index Names well.

(I am creating the column via “Id int IDENTITY(1,1) PRIMARY KEY”. I see the crazy index name that Sql Server CE generates, but I’m not sure the best way to “use” it.)

Also, I saw this note in msdn docs (http://technet.microsoft.com/en-us/library/ms173393%28SQL.100%29.aspx):

“SQL Server Compact 3.5 can use indexes to enforce PRIMARY KEY and UNIQUE constraints. We recommend that you do not rely on this behavior nor try to modify any indexes that are created as part of a constraint.”

What is the best way to retrieve items (for Update) based on the Primary Key?

UPDATE:

I found that I can give a custom name to the Primary Key like this:

CREATE TABLE TEST2 (Id int CONSTRAINT PKID PRIMARY KEY)

So I could then use PKID as the Index Name … why would I not be able to “rely on this behavior”?

  • 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-20T04:37:23+00:00Added an answer on May 20, 2026 at 4:37 am

    I found that I can give a custom name to the Primary Key like this:

    CREATE TABLE TEST2 (Id int CONSTRAINT PKID PRIMARY KEY)

    So I could then use PKID as the Index Name.

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

Sidebar

Related Questions

I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005
I've successfully built SDL from source using bcc 5.5.1 but any SDL test application
Has anyone successfully talked profibus from a .NET application? If you did, what device/card
I can successfully connect to MySQL from a DOS prompt, but when I try
I am (successfully) calling the Windows FilterSendMessage function in c# using the following pinvoke
I'm getting a timeout error when trying to execute a LINQ (-to-SQL) query System.Data.SqlClient.SqlException:
I have a table programparticipants . I am currently successfully querying the IDs where
I have been successful in querying a Microsoft Access 2003 database (.mdb file) and
just successfully imported a db from a real website to my local website. the

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.