Monthly Archive:: June 2013

Get Identity value of the recently added record

The below three built-in functions can be used to get the identity of the mostly added record. @IDENTITY It returns the last identity value generated for any table in the current session, across all scopes. Let me explain this… suppose we create an insert trigger on table which inserts a row in another table with generate an

Date Formatting Cheat Sheet in C#.Net

Syntax: <%= String.Format(“{specifier}”, DateTime.Now) %> Specifier Description Output d Short Date 8/4/2007 D Long Date 8-Apr-07 t Short Time 21:08 T Long Time 21:08:59 f Full date and time 4/8/2007 21:08 F Full date and time (long) 4/8/2007 21:08 g Default date and time 8/4/2007 21:08 G Default date and time (long) 8/4/2007 21:08 M

VBScript equivalent string functions in C#.Net

C# Method VBScript Description IndexOf() InStr Returns the position of the first occurrence of one string within another. The search begins at the first character of the string – InStrRev Returns the position of the first occurrence of one string within another. The search begins at the last character of the string ToLower() LCase Converts

Asp.Net Xml Exceptions Cheat Sheet

Exception Description UpaException XmlException Returns detailed information about the last exception. XmlSchemaException Returns detailed information about the schema exception. XmlSchemaInferenceException Returns information about errors encountered by the System.Xml.Schema.XmlSchemaInference class while inferring a schema from an XML document. XmlSchemaValidationException Represents the exception thrown when XML Schema Definition Language (XSD) schema validation errors and warnings are encountered

C#.Net Regular Expression Cheat Sheet Reference

Character Description Marks the next character as either a special character or escapes a literal. For example, “n” matches the character “n”. “n” matches a newline character. The sequence “\” matches “” and “(” matches “(“. Note: double quotes may be escaped by doubling them: “<a href=””…>” ^ Depending on whether the MultiLine option is

Check a checkbox using jQuery or JavaScript?

To check this you can Use the new .prop() function: $(‘.chkTest’).prop(‘checked’, true); $(‘.chkTest’).prop(‘checked’, false); But it will work only injQuery 1.6 and above.  To check in jQuery 1.5 and below versions you need to use .attr(). To check the checkbox (by setting the value of the checked attribute) do $(‘.chkTest’).attr(‘checked’,’checked’); and for un-checking (by removing