Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 connection string

Author  Topic 

elic05
Yak Posting Veteran

62 Posts

Posted - 2012-11-22 : 14:51:48
a virtual machin on a cloud host my site
the ms sql server is on the same windows server
i wrote this connection string to commubicate between the site and the sql server but its not working
Data Source=.\;AttachDbFilename=|DataDirectory|\aa.MDF;Integrated Security=True;Trusted_Connection=Yes
.\ - its the only sql server instance i have, and that the way I get to it with the management studio
and because the host and the sql server are on the same os, I thought that should be the source.
and it is in the data directory, and the name of the mdf file is aa.MDF
where is my mistake?
if there is a better place to post this question, I will be happy to know.
thanks

revdnrdy
Posting Yak Master

220 Posts

Posted - 2012-11-29 : 13:46:10
quote:
Originally posted by elic05

a virtual machin on a cloud host my site
the ms sql server is on the same windows server
i wrote this connection string to commubicate between the site and the sql server but its not working
Data Source=.\;AttachDbFilename=|DataDirectory|\aa.MDF;Integrated Security=True;Trusted_Connection=Yes
.\ - its the only sql server instance i have, and that the way I get to it with the management studio
and because the host and the sql server are on the same os, I thought that should be the source.
and it is in the data directory, and the name of the mdf file is aa.MDF
where is my mistake?
if there is a better place to post this question, I will be happy to know.
thanks



The attachdbfilename is specific to sql express I think (not certain though). Are you using that?

Go to Top of Page

johnson_ef
Starting Member

16 Posts

Posted - 2012-11-30 : 04:21:41
Just to understand the issue clear,

Are you using connection string to connect to Existing DB or are you trying to attach a DB with a Connection string?

-Johnson
Go to Top of Page
   

- Advertisement -