When to Use CTE: It stands for Common table expression.it was introduced on sql server 2005. Below is details for using a CTE: This is used to store result of a complex sub query for further use. It is also used to create a recursive query. When to use Temporary Table: It is created at Run-time and behave same as… Read more →
Month: August 2014
Reflection in .Net
The classes in the System. Reflection namespace, together with System.Type, enable to obtain information about loaded assemblies and the types defined within them, such as classes, interfaces, and value types. We can also use reflection to create type instances at run time, and to invoke and access them. For topics about specific aspects of reflection. Assemblies contain modules, modules contain… Read more →
Difference between Convert,Explicit type,Tryparse and Parse c#
(int)Something; int.Parse(Something); Convert.ToInt32(Something); 1) that is a cast 2) Parsing taking in a string and attempts to convert it to a type. —when string is null refence,it will throw ArgumentNullException.if string is other than integer value ,it will throw FormatException.if reperesents a number less than Min or maxvalue than will throw overflowexception. string s1 = “1234”; string s2 = “1234.65”;… Read more →
Boxing and Unboxing
Boxing is used to store value types in the garbage-collected heap. Boxing is an implicit conversion of a value type to the type object or to any interface type implemented by this value type. Boxing a value type allocates an object instance on the heap and copies the value into the new object Boxing Conversion explicit boxing is never required:… Read more →
Use as and is Operators for casting
The as operator is more efficient because it actually returns the cast value if the cast can be made successfully. The is operator returns only a Boolean value. It can therefore be used when we just want to determine an object’s type but do not have to actually cast it. Use the is operator to verify the type before performing a… Read more →
jQuery Validation
<!DOCTYPE html> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <title>Validation</title> <link href=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/validationEngine.jquery.css” rel=”stylesheet” /> <script src=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/jquery-1.8.2.min.js”></script> <script src=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/languages/jquery.validationEngine-en.js”></script> <script src=”http://cdnjs.cloudflare.com/ajax/libs/jQuery-Validation-Engine/2.6.4/jquery.validationEngine.js”></script> <script type=”text/javascript” src=”http://cdn.b3website.com/jquery-inputmask/jquery.inputmask.bundle.min.js”></script> <script type=”text/javascript”> $(document).ready(function () { jQuery(“#MyForm”).validationEngine(); }); </script> </head> <body> <form id=”MyForm” class=”formular” method=”post”> <br /><br /><br /> <input id=”Text1″ type=”text” class=”validate[required,custom[integer],max[50]] text-input” /><br /><br /> <input id=”Text2″ type=”text” class=”validate[required] text-input” /><br /><br /> <input id=”Text3″ type=”text” class=”validate[required] text-input” /><br /><br… Read more →
Visual C# Code Snippets
Link By default the following code snippets are included in Visual Studio. Name (or shortcut) Description Valid locations to insert snippet #if Creates a #if directive and a #endif directive. Anywhere. #region Creates a #region directive and a #endregion directive. Anywhere. ~ Creates a destructor for the containing class. Inside a class. attribute Creates a declaration for a class that derives from Attribute. Inside a namespace (including… Read more →
Generic Types
Only classes, structures, interfaces, and delegates can be written generically; enum types cannot. Read more →
Entity framework questions
1) What is the advantage and disadvantage of Entity Framework Advantages: One common syntax (LINQ) for all object queries whether it is database or not , Pretty fast if used as intended , easy to implement SoC , less coding required to accomplish complex tasks. Its fast and straight forward using LINQ/FE objects For Add/Modify/Delete/Update. Easy to map business objects… Read more →
Some Public functions are not showing in object or drive class
All constructor functions are PUBLIC but not showing in object or inherited class object. Constructors never return anything.(constructors always void) public static member are also not show in any object. Read more →