adsense

Wednesday, August 30, 2017

Refused to display in a frame because it set 'X-Frame-Options' to 'DENY'

You might Sometimes encounter the error above when you are using iframes w to load resources outside from the domain.

This Issue can be fixed in two ways

1) Add this to web.config

<httpProtocol>
    <customHeaders>
      <add name="X-Frame-Options" value="AllowAll" />
    </customHeaders>
  </httpProtocol>

2) Add this to Global.asax.cs

protected void Application_PreSendRequestHeaders()
{
 Response.Headers.Remove("X-Frame-Options");
 Response.AddHeader("X-Frame-Options", "AllowAll");
}
 
Please read this discussion in stackoverflow for a detailed discussion on the topic.

Regards,
Samitha


Wednesday, August 9, 2017

drop database user that owns a schema


First you will have to determine the schema's owned by a given user in order to  drop the user.

Execute the following query to determine the schemas owned by the user  named ‘user1’ .

SELECT name FROM sys.schemas
WHERE principal_id = USER_ID('user1');

When you run the query above, suppose you get db_datawriter as the schema owned by user (in this case user1)

Next step is to change the owner of the schema db_datawriter to some other user (e.g. dbo):

ALTER AUTHORIZATION ON SCHEMA::db_datawriter TO dbo;



You will have to remove all the schemas to drop a db user. When the user has no schemas owned you can drop it.