Engineering

Prevent Saving Changes That Require Table Re-creation SQL Server

I was modifying an existing table using SQL Server Management Studio, but I got this error message on saving:Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created...

How to Dynamically Select rows in SQL Server

If you want to restrict other developers from using your Stored Procedures that returns a huge amount of data which affects server performance and Application Performance weather it is a Windows or Web Application.You can use the following idea when you create Stored Procedures:-- ============================================= -- Author: ...

How to convert DataRow to DataRowView

Converting DataRow to DataRowView is not possible, but we can go around this by using DefaultView property of the Data Row Table.The following code example demonstrate how to get DataRowView out of DataRow:DataTable dt = new DataTable();dt.Columns.Add("ID", typeof(int)); dt.Columns.Add("Name", typeof(string));for (int i = 0; i < 10; i++) { DataRow tempDR =...

A potentially dangerous Request.Form value was detected from the client ASP.NET

I got this error message when I try to submit a form with HTML Code, the default settings of the .NET Framework will not allow me to submit HTML Code to prevent cross-site scripting (XSS) attacks.To avoid this error set Validate Request to false in the Page Directive.ValidateRequest="false" but this is...

How to remove HTML tags from string in C#

I will show you three different methods to remove HTML tags from string in C#:1. By using Regex:public static string RemoveHTMLTags(string html) { return Regex.Replace(html, "<.*?>", string.Empty); }2. By using Compiled Regex for better performance:static Regex htmlRegex = new Regex("<.*?>", RegexOptions.Compiled); public static string RemoveHTMLTagsCompiled(string html) { return htmlRegex.Replace(html, string.Empty); }3. By...

XML Data and Document Storage in SQL Server

XML is a platform-independent data representation format based originally on SGML. Since its popularization, it is becoming used as a data storage format. It has its own type system, based on the XML Schema Definition language (XSD). Both XML and XSD are W3C standards at the Recommendation level. An XML...