Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

I have an app running Asp.Net MVC v. 5.2.3...I am trying to get it hosted at Azure....I am unable to do so...

I am able to access the dB created at Azure and the SQL Server both at Azure and via SSMS. I am even able to see the database in SQL Server Object Explorer inside of VS 2017. I am trying to use the Publish feature available in VS.

I encounter this error...

Server Error in '/' Application. CREATE TABLE permission denied in database 'master'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: CREATE TABLE permission denied in database 'master'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): CREATE TABLE permission denied in database 'master'.]

Which, from what I've read, seems like it would be a permissions issue, but it isn't...because I am global administrator with all rights....

Seems to bomb here...

public class WineController : Controller
{
    // *********************************************************    
    // ********* GET: ListWine View ****************************
    // *********************************************************

    public ActionResult Index()
    {

        // *************************************************
        // *** Establish New WineContext (Plate of Data) ***
        // *** And Return the list of wine *****************
        // *************************************************

        using (var context = new WineContext())
        {
            var x = context.Wines.Include(w => w.TheVarietal).ToList();
            return View("ListWine", x);
        }

    }

1 Answer

It could be a permissions issue, but not in regards to the publisher of the app, but to a service within, ie sql. This is mainly because rights may not be inherited; an example is IIS server where i had used it with admin rights but i had to grant full rights to it. Take a look here: https://docs.microsoft.com/en-us/sql/t-sql/statements/grant-database-permissions-transact-sql#examples.