all groups > sql server mseq > january 2006 >
You're in the

sql server mseq

group:

Microsoft SQL Server Management Studio Express



Microsoft SQL Server Management Studio Express Nick K
1/2/2006 8:21:52 AM
sql server mseq: I am attempting to connect to a SQL Server 2005 database using a Visual
Studio.Net 2003 application.

When I use this connection string, I get a Keyword not supported: 'user
instance'. error.
<add key="SiteSqlServer" value="Data Source=.\SQLExpress;uid=sa;pwd=;User
Instance=True;AttachDBFilename=|DataDirectory|MyDB.mdf;Initial
Catalog=MyDB;" />

When I remove the "User Instance=True", I get a

Database 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\MyDB.mdf'
already exists. Could not attach file '|DataDirectory|MyDB.mdf' as database
'MyDB'.

What kind of connection string do I use and why doesn't VS2003 recognize the
"User Instance=True"?

Re: Microsoft SQL Server Management Studio Express Nick K
1/2/2006 10:38:47 AM
I read the document. I don't see an explanation of the "User Instance=True",
keyword not recognized error I am seeing. Is this because my SQLClient is
the .Net Framework 1.1? I'm currently using VS 2003

[quoted text, click to view]

Re: Microsoft SQL Server Management Studio Express Andrew J. Kelly
1/2/2006 11:20:04 AM
See if this helps:
http://msdn.microsoft.com/sql/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp


--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

Re: Microsoft SQL Server Management Studio Express Andrew J. Kelly
1/2/2006 1:11:46 PM
I think you should re-read the document again and make sure you understand
exactly what a "User Instance" really is. If you really want to use a User
Instance you can not use SQL Logins as stated in the document. If you don't
really want a User instance you connect just like any other connection to
SQL Server but you do not need to attach the files. This assumes you have
already loaded SQL Server on that machine. I am not sure if when using a
User Instance if you need the 2.0 client or not but I suspect you might.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

AddThis Social Bookmark Button