Q. What is the best way to turn on HTTP Strict Transport Security on an IIS 7 web server? Ans: This can be done by adding following block in Web.Config: <system.webServer> <httpProtocol> <customHeaders> <add name ="X-CustomName" value="MyCustomValue"/> </customHeaders> </httpProtocol> </system.webServer> We have to configure on IIS that has the ability to custom headers to response: Go to Internet Information Services(IIS) Manager. Configure Response headers that are added to response from the server. Now add your custom header Name and custom Value (Custom header name and value should be same as that in Web.Config).
INTRODUCTION Truncate and Delete in SQL are two commands which is used to remove or delete data from table. Though quite basic in nature both Sql commands can create lot of trouble until you are familiar with details before using it. An Incorrect choice of command can result is either very slow process or can even blew up log segment, if too much data needs to be removed and log segment is not enough. That's why it's critical to know when to use truncate and delete command in SQL but before using these you should be aware of the Differences between Truncate and Delete , and based upon them, we should be able to find out when DELETE is better option for removing data or TRUNCATE should be used to purge tables. I have still seen people firing delete command just to empty a table with millions of records which eventually lock the whole table for doing anything and take ages to complete or Simply blew log segment or hang the machine. Truncate Use truncate table if you need
Extension method is a new feature in C# 3.0. Extension methods allow existing classes to be extended without relying on inheritance or having to change the class's source code. This means that if you want to add some methods into the existing String class you can do it quite easily. Here's a couple of rules to consider when deciding on whether or not to use extension methods: Extension methods cannot be used to override existing methods. An extension method with the same name and signature as an instance method will not be called. The concept of extension methods cannot be applied to fields, properties or events. Use extension methods sparingly....overuse can be a bad thing!
Comments
Post a Comment