Raziaar
I Hate Custom Titles
- Joined
- Sep 13, 2003
- Messages
- 29,769
- Reaction score
- 140
Note to Mods: Please delete. Somebody on another forum helped me solve my problem. I put my original post in the spoiler tag.
Anybody here with SQL Server? I need help solving a ridiculously easy problem I'm having and can't seem to figure out related with connection strings.
The following connection string works for me in C#:
"Data Source=.\\SQLEXPRESS;database=master;Integrated Security=True;Connect Timeout=5;User Instance=True"
However, when I try to navigate to any other database on the SQLEXPRESS server, for instance MyCompany in place of master, it doesn't work. The database MyCompany is attached and is located in a directory that is one back from where the master directory is located, and I don't know how to direct it there.
master is located in SQLEXPRESS\Databases\System Databases\
But MyCompany is located in SQLEXPRESS\Databases\
How would I accomplish that? Nothing I do seems to work. I've tried the |DataDirectory| thing I've found on many websites, but that doesn't work... because I'm not trying to point to a database on the computer I'm using, I'm trying to point to one on the SQL Server.
The following connection string works for me in C#:
"Data Source=.\\SQLEXPRESS;database=master;Integrated Security=True;Connect Timeout=5;User Instance=True"
However, when I try to navigate to any other database on the SQLEXPRESS server, for instance MyCompany in place of master, it doesn't work. The database MyCompany is attached and is located in a directory that is one back from where the master directory is located, and I don't know how to direct it there.
master is located in SQLEXPRESS\Databases\System Databases\
But MyCompany is located in SQLEXPRESS\Databases\
How would I accomplish that? Nothing I do seems to work. I've tried the |DataDirectory| thing I've found on many websites, but that doesn't work... because I'm not trying to point to a database on the computer I'm using, I'm trying to point to one on the SQL Server.