Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1043

Re: How do I fix this error

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: How do I fix this error
Date 2012-05-11 09:02 +0200
Organization Erland Sommarskog
Message-ID <XnsA0505C0EC2366Yazorman@127.0.0.1> (permalink)
References <4fabfbd0$0$290$14726298@news.sunsite.dk> <XnsA04FF3151DD17Yazorman@127.0.0.1> <4fac40d5$0$293$14726298@news.sunsite.dk>

Show all headers | View raw


Tony (johansson.andersson@telia.com) writes:
> It was path problem that I had now it works. But I wonder you mentioned
> that using the AttachDBFilename was not so good according to you If I
> have a database called CarsDB.mdf with these setting in web.config how 
> would I write to skip this AttachDBFilename ? 
>
> The CarsDB.mdf is located in the App_data folder which the DataDirectory
> is refering to. 
> 
><connectionStrings>
>     <add name="CarsDBConnectionString2" connectionString="Data 
> Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\CarsDB.mdf;
>          Integrated Security=True;User Instance=True" />
>  </connectionStrings>
 
Attach the database to the servce once for all and change AttachDbFilename
to Database, strip ".mdf" and take out "User Instance=True".

-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How do I fix this error "Tony" <johansson.andersson@telia.com> - 2012-05-10 19:33 +0200
  Re: How do I fix this error Erland Sommarskog <esquel@sommarskog.se> - 2012-05-10 23:53 +0200
    Re: How do I fix this error "Tony" <johansson.andersson@telia.com> - 2012-05-11 00:27 +0200
      Re: How do I fix this error Erland Sommarskog <esquel@sommarskog.se> - 2012-05-11 09:02 +0200
        Re: How do I fix this error "Tony" <johansson.andersson@telia.com> - 2012-05-11 10:34 +0200
          Re: How do I fix this error "Tony" <johansson.andersson@telia.com> - 2012-05-11 11:14 +0200
          Re: How do I fix this error Erland Sommarskog <esquel@sommarskog.se> - 2012-05-11 12:54 +0200
      Re: How do I fix this error bradbury9 <ray.bradbury9@gmail.com> - 2012-05-10 22:44 -0700

csiph-web