Monday, June 29, 2015

Adding 'meta' tag in ASP.NET to ensure browser compatibility

Meta tag is very useful to solve most of the browser compatibility issues. If its is html, we need to add it in each page. But in ASP.NET we can straight away add it in Web.config file that will be applied to all the pages. Here is how,

Just add the below config in ASP.NET Web.config file.
<system.webServer>
 <httpProtocol>
  <customHeaders>
   <clear/>
   <add name="X-UA-Compatible" value="IE=9; IE=8; IE=7; IE=EDGE"/>
  </customHeaders>
 </httpProtocol>
</system.webServer>

Below is some of the rendering modes we can use,

ValueRendering mode
IE=9Use the Windows Internet Explorer 9 standards rendering mode
IE=8Use the Internet Explorer 8 standards rendering mode
IE=7Use the Windows Internet Explorer 7 standards rendering mode
IE=5Use the Microsoft Internet Explorer 5 standards rendering mode

Thursday, June 25, 2015

(Solved) SQL Server Error: This database is not enabled for publication.

To enable a database for replication,
  1. On the Publication Databases page of the Publisher Properties [Publisher] - dialog box, select the Transactional and/or Merge check box for each database you want to replicate. 
  2. Select Transactional to enable the database for snapshot replication. 
  3. Click OK.

(Solved) SQL Server Error: Cannot drop the database because it is being used for replication.

Solution:

Drop the replication in the corresponding database using the below Stored Procedure query. Then delete the Database.
sp_removedbreplication 'YOUR_DATABASE_NAME'