This is my first "code first approach" with SQL Server 2012 Express.
I'm trying to create a database but there is a problem with the connection string.
This is my connection string:
Data Source=AMBROGIO\SQLEXPRESS;Initial Catalog=TAP2014_15Project;Integrated Security=True;
This is the connection string which arrives to my setup function:
Data Source=AMBROGIO\\SQLEXPRESS;Initial Catalog=TAP2014_15Project;Integrated Security=True;
With a double \\
after the name of my Pc.
For a test I've tried to write something else as connection string and under debugging it arrives without modification (obviously it raises an error).
Someone can please help me ?
Thanks.
Filippo
Hi, sorry if I reply only now. Yes I was using the debugger to look the string.
Now the error that I have is an exception raise by my method:
db.Database.CreateIfNotExists();
error:
Exception:Thrown: "Cannot open database "TAP2014_15Project" requested by the
login. The login failed.
Login failed for user 'AMBROGIO\Filippo'."
(System.Data.SqlClient.SqlException)
A System.Data.SqlClient.SqlException was thrown: "Cannot open database
"TAP2014_15Project" requested by the login. The login failed.
Login failed for user 'AMBROGIO\Filippo'."