I have an idea of what might be causing your problem;
You should check that your current Connection String contains a default catalogue parameter and possibly make sure that your application's database user default database is set.
Setting The initial catalogue/database variable in the connection string:
You might have miss typed or forgot to include a default catalogue/database in your connection string.
Including the default catalogue
in your connection string tells your database server which database to use for your requests. (In this case, your LINQ/entity framework requests.)
Here is an example of a connection string containing a default catalogue:
data source=[Your server's address];initial catalog=[Your database CachedeskBase in your case];persist security info=[set to false if you plan on using sql authentification, else true];user id=[Your default user];password=[your user's password];MultipleActiveResultSets=True;App=EntityFramework
Side note: in a production or even development environment you shouldn't include plain database usernames and passwords. I would recommend you look into ISS App Pools if you are planning on deploying this application. When using an app pool you do not specify a user for your application and therefore their passwords. The user id and password fields are replaced by integrated security
tag
Setting the application's database user default database:
This action is not recommended as you should always have a default catalogue/database for your user that doesn't contain any potentially dangerous data. This is mostly for security as you want to add hurdles in the path of potential intruders. Making your application's database your user's default database should not be something you want to happen.
As I have a SQL server instance running, I'll be using SQL Server for my example.
In SQL Server Management Studio, go to the security
folder and then in the logins
folder of the object editor for your database and double click on your user. (If you are using IIS app pools, look for IIS APPPOOL\[your app pool name]
).
This should open the login properties window, allowing you to set the default database of your user.
