30

Hi I am using sql server fulll edition.

any idea how should I solve this issue, I search on net but not found any helpful answer.

Thanks

BreakHead
  • 10,480
  • 36
  • 112
  • 165

4 Answers4

55

SQL Server 2005(Full Version) does not support the "user instance"(automatic creation of databases from code) directive in the connection string. Its a feature of sql server express edition.

Also if your connection string has user Instance attribute, then try removing the "User Instance=True;"

Sachin Shanbhag
  • 54,530
  • 11
  • 89
  • 103
  • that's true! Working great! – Suhrob Samiev Jan 29 '13 at 11:00
  • This was it: try removing the "User Instance=True;" – Gary Huckabone Nov 21 '15 at 06:17
  • +1. I it worked when I switched to SQL Express. But if I've to make it work with my server or full edition, I'm unable to find the place where I can edit/remove this attribute. I don't know where does LINQPad stores its connection string or if there is really a way to edit it in the tool? I observed two files namely "LINQPad.exe.config" and "LPRun.exe.config" in the installation directory of LINQPad but to no avail. – RBT Jul 26 '16 at 06:11
5

Automatic creation of databases from code is a feature of the SQL Express Edition. Try modifying your connection string after having manually created the FOO database:

server=SERVERNAME;database=FOO;uid=sa;pwd=
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
3

User instancing is a feature of Sql Express only and is not available in full Sql Server. You need to construct your connection string to point at the DB server without any USer Instancing defined

Macros
  • 7,099
  • 2
  • 39
  • 61
1

User Instancing (which allows the automatic creation of databases from code) is not supported on the full version of SQL Server, only on the Express version.

The solution is to manually create the database in SQL Server and set the connection string to point to it. You will also need to run aspnet_regsql.exe manually against the database if you will be using any of the new built-in database features of ASP.NET v2.0.

Ref.

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541