1

The website runs perfectly fine on my local computer with connection string containing database information of already hosted server. but when i upload the website on the server i get this error. the main page of the website is loading but the other features that has sql connection accessibility are not.

System.ComponentModel.Win32Exception: Access is denied

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.)]

My local default connection string is

 <add name="defaultconnection" connectionString="Data Source=(LocalDb)\mssqllocaldb;Initial Catalog=aspnet-fuzzzz-20160406102902;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-fuzzzz-20160406102902.mdf" providerName="System.Data.SqlClient" />

Apart from that i have the entity framework model connection string that contains sql authentication of a remote server that contains data..

Revised and additional information - my filter looks like this could it be the server is by default taking my default connection string instead of my entity framework connection string

 public SimpleMembershipInitializer()
        {
            Database.SetInitializer<UsersContext>(null);

            try
            {
                using (var context = new UsersContext())
                {
                    if (!context.Database.Exists())
                    {
                        // Create the SimpleMembership database without Entity Framework migration schema
                        ((IObjectContextAdapter)context).ObjectContext.CreateDatabase();
                    }
                }

                WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);
             }
             }
Himaan Singh
  • 725
  • 1
  • 7
  • 17

0 Answers0