I have created a winforms application with Visual Studio 2010 and a setup project for it. My application works with SQL Server Express so I have added SQL Server 2008 Express to the list of prerequisites of the setup.
In addition I have used the following connection string to connect to my database :
Data Source=.\SQLEXPRESS;AttachDBFileName=|DataDirectory|MyDBName.mdf; Integrated security=True;
My application and its setup project build successfully but when I have installed and run it (even as administrator) I receive an error :
cannot open a user default database.login failed. login failed for this user.
What is my mistake??