What are the limitations to SQL Server Compact? (Or - how does one choose a database to use on MS platforms?)

后端 未结 9 389
忘掉有多难
忘掉有多难 2020-12-02 14:10

The application I want to build using MS Visual C# Express (I\'m willing to upgrade to Standard if that becomes required) that needs a database.

I was all psyched ab

相关标签:
9条回答
  • 2020-12-02 14:45

    There are constraints... Joel seems to have addressed the details. SQL CE is really geared for mobile development. Most of the "embedded" database solutions have similar constraints. Check out

    • SQLite

      • No TEXT field character limit
      • Auto increment only on INTEGER PRIMARY KEY column
      • Some third party encryption support
    • Esent

      • (unmanaged code isn't my forte, and I can't decipher the unmanaged docs)
    0 讨论(0)
  • 2020-12-02 14:51

    According to this post (http://www.nelsonpires.com/web-development/microsoft-webmatrix-the-dawn-of-a-new-era/) it says that because it uses a database file, only one process can access it for every read/write and as a result it needs exclusive access to the file, also it is limited to 256 connections and the whole file will most likely have to be loaded in memory. So SQL server compact might not be good for your site when it grows.

    0 讨论(0)
  • 2020-12-02 14:57

    A few, hopefully helpful comments:

    1st - do not use SQLite unless you like having to have the entire database locked during writes (http://www.sqlite.org/faq.html#q6) and perhaps more importantly in a .Net application it is NOT thread safe or more to the point it must be recompiled to support threads (http://www.sqlite.org/faq.html#q6)

    As an alternate for my current project I looked at Scimore DB (they have an embedded version with ADO.Net provider: http://www.scimore.com/products/embedded.aspx) but I needed to use LINQ To SQL as an O/RM so I had to use Sql Server CE.

    The auto increment (if you are referring to automatic key incrementing) is what it always has been - example table:

    -- Table Users

    CREATE TABLE Tests (
        Id       **int IDENTITY(1,1) PRIMARY KEY NOT NULL,**
        TestName     nvarchar(100) NOT NULL,
        TimeStamp    datetime NOT NULL
    )
    GO
    

    As far as the text size I think that was answered.

    Here is a link to information on encryption from microsoft technet: (http://technet.microsoft.com/en-us/library/ms171955.aspx)

    Hope this helps a bit....

    0 讨论(0)
提交回复
热议问题