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


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

Re: How do I fix this error

From bradbury9 <ray.bradbury9@gmail.com>
Newsgroups comp.databases.ms-sqlserver
Subject Re: How do I fix this error
Date 2012-05-10 22:44 -0700
Organization http://groups.google.com
Message-ID <7659906.610.1336715079870.JavaMail.geo-discussion-forums@vbq19> (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


El viernes, 11 de mayo de 2012 00:27:28 UTC+2, Tony  escribió:
> 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>
> 
> //Tony
> 
> 
> "Erland Sommarskog"  skrev i meddelandet 
> news:XnsA04FF3151DD17Yazorman@127.0.0.1...
> > Tony writes:
> >> I have tried with Visual Studio 2010 Proffessional and Visual Web
> >> developer express 2010 but I get the following error when I try to run
> >> the web site. I have also sql server 2008 installed. I addending a
> >> cource and when I try to run the web site that we have got as examples I
> >> get this error.
> >> Does anyone know how to correct so I can run the examples ?
> >>
> >>
> >> Here is the error that I get
> >> *******************
> >> An attempt to attach an auto-named database for file G:\ASP Module
> >> 3\CarsDB.mdf failed. A database with the same name exists, or specified
> >> file cannot be opened, or it is located on UNC share.
> >
> > Reading the error message, there appears to be three possibilities:
> >
> > 1) You already have a database CarsDB.
> > 2) There is no file G:\ASP Module 3\CarsDB.mdf
> > 3) G is a mapped network drive.
> >
> > The AttachDBFilename is a connection-string option that I've never
> > understood the point with. Why not just attach the database once and
> > for all?
> >
> > -- 
> > Erland Sommarskog, SQL Server MVP
> >
> > 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
> >

Try not to double post

Back to comp.databases.ms-sqlserver | Previous | NextPrevious 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