0

Hello,
I'm using Windows 7 Ultimate 64bit, Visual Web Developer 2010 and Microsoft SQL 2008 Express SP1(local). SQL server is set to windows authentication, I'm on admins account but the problem is that I can't work with database. It keeps doing errors with connection etc. (I have to use VirtualBox with windows XP to do projects and its really killing me inside). ASP.NET code works fine until it tries to connect or write to the database

I'd like to ask what setup of IIS, VVD or SQl server should I edit and how. I've tried to google my problem but I can't find any solution which would be 'step by step' or working one.

I know this may not be appropriate section of forum but I've already tried SQL section with no response.

Any help would be really appreciated.

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Ycefire
0

For ConnectionString like:

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\inetpub\wwwroot\k\App_Data\Database.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"

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.

And for ConnStr with User Instance=False

CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\inetpub\wwwroot\k\App_Data\Database.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

SQL server is set to Local Service and only Shared Memory is enabled.

1

try this connection string..
Server=localhost;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;

it should work..

0

Sir, you're a genius!
Thank you very much, finaly I got my projects to work on Vista/Win 7.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.