sql server express connection string

后端 未结 6 2389
北恋
北恋 2021-02-19 23:11

Is there a difference between sql server connection string and the express vesion?!

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-20 00:10

    I recently downloaded a sample application from the Telerik site and could not get it to run on my machine that has only SQL Server 2008 SP1 Developer Edition installed until I did a find and replace of all "User Instance=True" with "User Instance=False".

    Before anybody goes and gets their panties all twisted in a knot, hear me out first. My circumstances may be (but ought not be) unique in that instead of installing SQL Server 2008 Express just to run example applications (e.g., Telerik), I simply installed a second named instance of SQL Server named, you guessed it, sqlexpress on my copy of SQL Server 2008 Developer Edition. That way when the Telerik (or you name it) demo application tries to connect to "Data Source=.\sqlexpress", it's none the wiser that what it's really connecting too is "big SQL Server" (which is what SQL Server Developer Edition is for the purposes of this posting).

    The key conecpts (dare I say "money quote") you need to understand are these:

    SQL Express allows (actually assumes if missing) User Instance=True, so if you are running a named instance called sqlexpress on "big SQL" (Developer, Standard, Enterprise or Data Center), then you just need to find/replace User Instance=True with User Instance=False in the connecton string and your worries are over. Even the "Attach database" stuff (that I see in the Telerik connectionStrings section of their web.config) works on "big SQL" (contrary to what somebody posted earlier in this thread).

    Here's an actual example taken directly from the web.config of the Telerik web.config file after I "fixed it up":

    
        
        
        
        
        
        
        
    
    

提交回复
热议问题