A few of ideas:
First the connection you have specified is pointing at the local machine:
Data Source=.\\SQLEXPRESS
, so the machine the application runs on will also need a SQLExpress server running as "SQLEXPRESS". This could be the cause of your problem. (It is difficult to tell as so many factors come into play). To form a more portible connection string
this site may be of help[
^]. You should also check the mdf file is deployed on installation. This is a slightly unusual setup as databases are typically deployed to a common server rather than locally.
The second thing is that it is more usual to store your config in the app.config (or web.cofig) file, it means you can change the database connection without deploying code for one thing. Instructions for doing that can be found
here[
^]. You can change the config according to debug and release builds, but how you do this depends on your application type and .net framework version. Finally, if you are worried about users seeing the connection string it is possible to encrypt it, this does take a little effort. You can see the basics
here[
^] but the instructions given may not fit your deployment scenario (they work on a web server for example, but the key must be accessible to the account running the application). It is possible to write your own
ProtectedConfiguationProvider
if necessary.