0
I have a project created in c# (ASP.NET 5 MVC) that uses an SQL database.
I published the project to a folder on the local server and created a database with Sql Server Management Studio (SSMS).
All goes well on IIS, however, the database being used by IIS is not the one I created on SSMS. If I go to the Link Chains menu on the IIS I can see that it points to the database I created, however, the data is not being recorded in that database.
To try to understand what was going on, I deleted all the databases that appeared to me listed in the SSMS, however the application continued to work perfectly. So I did a search on the server for MDF type files but I did not see any.
Connection string:
<add connectionString="Server=(localdb)\MSSQLLocalDB;Database=outraDB;Integrated Security=true" name="DefaultConnection" providerName="System.Data.SqlClient" />
Does anyone have any idea what’s going on ?
How the database connection is made?
– Augusto Vasques
The connection is made through a string Connection.
– Romeu
Can you show the Connection string or does it contain protected information? Because probably the cause of this behavior, which you described, is there.
– Augusto Vasques
Present your connection string... when you find it you will see that this question makes no sense.
– Leandro Angelo
<add connectionString="Server=(localdb)\MSSQLLocalDB;Database=outraDB;Integrated Security=true" name="DefaultConnection" providerName="System.Data.SqlClient" /> Como disse anteriormente esta connection string aponta para uma base de dados que eu criei, but if I delete this database the app works on it and contains the previously saved data.
– Romeu
If your application is not pointing to the base
outraDB
in the(localdb)\MSSQLLocalDB
is because you are using another connection string configured elsewhere... or you are waiting for the server to access your local machine while it is looking at itself...– Leandro Angelo