Monday, February 20, 2012

Microsoft SQL Server Management Studio Express

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"?
See if this helps:
http://msdn.microsoft.com/sql/defaul...xpuserinst.asp
Andrew J. Kelly SQL MVP
"Nick K" <nospam@.hotmail.com> wrote in message
news:eT0gKC7DGHA.1032@.TK2MSFTNGP11.phx.gbl...
>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"?
>
|||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
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23XxRkh7DGHA.796@.TK2MSFTNGP10.phx.gbl...
> See if this helps:
>
http://msdn.microsoft.com/sql/defaul...xpuserinst.asp[vbcol=seagreen]
>
> --
> Andrew J. Kelly SQL MVP
>
> "Nick K" <nospam@.hotmail.com> wrote in message
> news:eT0gKC7DGHA.1032@.TK2MSFTNGP11.phx.gbl...
Source=.\SQLExpress;uid=sa;pwd=;User
>
|||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
"Nick K" <nospam@.hotmail.com> wrote in message
news:%23Tn$rO8DGHA.2708@.TK2MSFTNGP11.phx.gbl...
>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
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:%23XxRkh7DGHA.796@.TK2MSFTNGP10.phx.gbl...
> http://msdn.microsoft.com/sql/defaul...xpuserinst.asp
> Source=.\SQLExpress;uid=sa;pwd=;User
>
|||Hello Nick,
I'm afraid that you need VS2005/.net 2.0 and SqlClient native data provider
for SQL Server support is included.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: "Nick K" <nospam@.hotmail.com>
>References: <eT0gKC7DGHA.1032@.TK2MSFTNGP11.phx.gbl>
<#XxRkh7DGHA.796@.TK2MSFTNGP10.phx.gbl>
>Subject: Re: Microsoft SQL Server Management Studio Express
>Date: Mon, 2 Jan 2006 10:38:47 -0700
>Lines: 44
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
>Message-ID: <#Tn$rO8DGHA.2708@.TK2MSFTNGP11.phx.gbl>
>Newsgroups:
microsoft.public.vsnet.general,microsoft.public.sq lserver.connect,microsoft.
public.sqlserver.mseq
>NNTP-Posting-Host: 70-59-19-126.hlrn.qwest.net 70.59.19.126
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.connect:46507
microsoft.public.sqlserver.mseq:7868 microsoft.public.vsnet.general:30200
>X-Tomcat-NG: microsoft.public.sqlserver.connect
>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
>"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
>news:%23XxRkh7DGHA.796@.TK2MSFTNGP10.phx.gbl...
>http://msdn.microsoft.com/sql/defaul...s/dnsse/html/s
qlexpuserinst.asp[vbcol=seagreen]
>Source=.\SQLExpress;uid=sa;pwd=;User
recognize
>
>

No comments:

Post a Comment