Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity Framework cannot retrieve database information if you don't have permission to the master database on a web hosting server
    primarykey
    data
    text
    <p><strong>Background information</strong>:</p> <p>I bought a 1.5 GB database on a web hosting server. It only gave me the permission to get access to the database. </p> <p><strong>Problem</strong>:</p> <p><img src="https://i.stack.imgur.com/BOajS.jpg" alt="Database connection error"></p> <p>You may not understand the Chinese characters, but you do know the mean of the last sentence and that is the key point of this error.</p> <p><strong>Reason</strong>:</p> <p>This happened when EF is trying to retrieve database information from the web server. As you can see it is trying to get the information of tables from the master database and INFORMATION_SCHEMA.TABLES view. This is the thing which caused this problem, because I am not granted to access to that database.</p> <p>So I hope I explained this problem clearly.</p> <p><strong>Workaround</strong>:</p> <p>I found a way to solve it. Create the EF on your own local database with exactly same database structure(same tables, same columns etc.) and then change the connectionString to point to the web Server.</p> <p><strong>Problem</strong>:</p> <p>Whenever there are changes on the database and you want to update the EF DataContext structure, it will always go to the master database and that view to get the information, so you have to change the connectionString back and forth. It has become trivial.</p> <p><strong>Question</strong>:</p> <p>Is there any other way to do it? I found that LINQ2SQL doesn't have this problem because it doesn't automatically retrieve information from database. Instead, users have to drag the tables they want to use.</p> <p>I am looking forward to any brilliant answers.</p> <p>Cheers</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload