Problem connecting to SQL Server Express in ASP.NET app running onVista

E

egress

I've created an SQL Server Express database with one table that I use
in my test envionement (Windows Vista). I'm developing an ASP.NET web
app with VS 2005 and try to connect to the express server to retrieve
some simple data (no not Membership data). My connection string is:

<connectionStrings>
<add name="MyTestDb" connectionString="Data Source=.
\SQLExpress;Integrated
DataDirectory|MyData.mdf;User Instance=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>

When I run the app, I get this error:
"Failed to generate a user instance of SQL Server due to failure in
retrieving the user's local application data path. Please make sure
the user has a local user profile on the computer. The connection will
be closed."

I've given "NETWORK SERVICE" every permission under the sun to the
App_Data folder, so I don't think that is the problem.

Can anyone help me on this one. I'm thinking this is some weird user
permission thing that happens with Vista. However, I have UAC
disabled and run VS2005 as Admin.

Also, the weird thing is that VS2005 will setup the ASPNEDDB.mdf and I
can use it for Membership data with no problem, but I can't seem to
setup my own db to use.

Thanks in advance for your help.
jim
 
M

Michael Nemtsev [MVP]

Hello egress,

See there http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=152338&SiteID=1

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


e> I've created an SQL Server Express database with one table that I use
e> in my test envionement (Windows Vista). I'm developing an ASP.NET
e> web app with VS 2005 and try to connect to the express server to
e> retrieve some simple data (no not Membership data). My connection
e> string is:
e>
e> <connectionStrings>
e> <add name="MyTestDb" connectionString="Data Source=.
e> \SQLExpress;Integrated
e> DataDirectory|MyData.mdf;User Instance=true;"
e> providerName="System.Data.SqlClient" />
e> </connectionStrings>
e>
e> When I run the app, I get this error:
e> "Failed to generate a user instance of SQL Server due to failure in
e> retrieving the user's local application data path. Please make sure
e> the user has a local user profile on the computer. The connection
e> will
e> be closed."
e> I've given "NETWORK SERVICE" every permission under the sun to the
e> App_Data folder, so I don't think that is the problem.
e>
e> Can anyone help me on this one. I'm thinking this is some weird user
e> permission thing that happens with Vista. However, I have UAC
e> disabled and run VS2005 as Admin.
e>
e> Also, the weird thing is that VS2005 will setup the ASPNEDDB.mdf and
e> I can use it for Membership data with no problem, but I can't seem to
e> setup my own db to use.
e>
e> Thanks in advance for your help.
e> jim
 
E

egress

Hello egress,

See therehttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=152338&SiteID=1

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog:http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

Thanks for the tip Michael. That thread led me in the right
direction. It was actually something as simple as having
impersonation enabled. I disabled it and presto. No problems.
Thanks again.

egress
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top