AJAX Interview Questions #1

What’s AJAX ? AJAX (Asynchronous JavaScript and XML) is a newly coined term for two powerful browser features that have been around for years, but were overlooked by many web developers until recently when applications such as Gmail, Google Suggest, and Google Maps hit the streets. Asynchronous JavaScript and XML, or Ajax (pronounced "Aye-Jacks"), is [...]

JavaScript Interview Questions #1

What’s relationship between JavaScript and ECMAScript? – ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3. What are JavaScript types? – Number, String, Boolean, Function, Object, Null, Undefined. How do you convert numbers between different bases in JavaScript? – Use [...]

XML Interview Questions #1

1. What is XML? XML is the Extensible Markup Language. It improves the functionality of the Web by letting you identify your information in a more accurate, flexible, and adaptable way. It is extensible because it is not a fixed format like HTML (which is a single, predefined markup language). Instead, XML is actually a [...]

JavaScript & AJAX Interview Questions #1

1.  Why so JavaScript and Java have similar name? A.  JavaScript is a stripped-down version of Java B.  JavaScript’s syntax is loosely based on Java’s C.  They both originated on the island of Java D.  None of the above   2.  When a user views a page containing a JavaScript program, which machine actually executes [...]

Inherit DataGridView in Windows Forms

  Code Snippet using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace DataGridViewInheritance {     [Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]     public partial class DataGridViewEx : DataGridView     {         public DataGridViewEx()         {             InitializeComponent();         }     } }

Comma-Delimited Output (SQL Server)

Using Query 1: USE Northwind 2: GO 3:  4: DECLARE @CustIDs VARCHAR(8000) 5: SELECT TOP 10 @CustIDs = ISNULL(@CustIDs + ‘,’, ”) + CustomerID FROM Customers 6: SELECT @CustIDs 7: GO   Using Cursor 1: DECLARE cCustomerIDs CURSOR FOR 2: SELECT [CustomerID] FROM [dbo].[Customers] ORDER BY [CustomerID] 3: DECLARE @CustomerIDs VARCHAR(8000) 4: DECLARE @CustomerID VARCHAR(10) [...]

Decimal to Byte array (vice versa)

1: public static byte[] DecimalToBytes(Decimal dec) 2: { 3: using (MemoryStream stream = new MemoryStream()) 4: { 5: using (BinaryWriter writer = new BinaryWriter(stream)) 6: { 7: writer.Write(dec); 8: return stream.ToArray(); 9: } 10: } 11: } 1: public static Decimal BytesToDecimal(byte[] src) 2: { 3: if (src.Length == 1) 4: { 5: return Decimal.Parse(((char)src[0]).ToString()); [...]

Byte array to String (vice versa)

1: public static string BytesToString(byte[] bytes) 2: { 3: ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 4: return enc.GetString(bytes); 5: } 1: public static byte[] StringToBytes(string str) 2: { 3: ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 4: return enc.GetBytes(str); 5: }

Byte array to Integer (vice versa)

1: public static int BytesToInt(byte[] bytes) 2: { 3: return int.Parse(BytesToString(bytes).Trim()); 4: } 5:  6: public static string BytesToString(byte[] bytes) 7: { 8: ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 9: return enc.GetString(bytes); 10: } 1: public static byte[] IntToBytes(int value) 2: { 3: ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 4: return enc.GetBytes(value.ToString()); 5: } Code Snippet         /// [...]

Hexadecimal to Integer (vice versa)

1: public static int HexToInteger(string HexString) 2: { 3: return int.Parse(HexString, System.Globalization.NumberStyles.HexNumber); 4: } 1: public static string IntegerToHex(int IntValue) 2: { 3: return IntValue.ToString("X"); 4: }