App_Data SQLExpress databases
Posted on 2008-11-05
I have a need to use the APP_Data folder to host my database to hold local test data. I have read several threads and got totally confused as thing wont work as I expect (or want)
What I want to do is use a current database without SQL Server installed. I read that you could detach the database mdf file and move it to the App_Data folder and away you go, but I get a connection error saying:
'Login failed for user 'WebService'. The user is not associated with a trusted SQL Server connection.'
This is my connection string:
<add name="AppDatabase" connectionString="Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|WS_Test.mdf;uid=WebService;pwd=ws;" />
Can I do what I want I'm trying to do.
If not what are my options.
And one more thing, if I create a database in the App_data folder I cannot set up user accounts for it, so what acount does it run under.