Skip to main content

Posts

Showing posts from 2011

Email Validation in .Net

Function for Email Validation 1. It allows max 5 dots(.) including .com and max 5 hyphen(-) 2. Only 4 Special Characters allowed are (- _ . @) 3. @ character is allowed only once and is mandatory. private bool email() {       string pattern = @"^([a-zA-Z0-9])+([\w_\.\-]([a-zA-Z0-9])*[a-zA-Z0-9])*@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}$)";       System.Text.RegularExpressions.Match match = Regex.Match(textBox1.Text.Trim(), pattern, RegexOptions.IgnoreCase);       if ((match.Success))       {             string[] words = Regex.Split(textBox1.Text.Trim(), "@");             string word1 = words[1].ToString();             int dotCount = word1.Count(f = > f == '.');             int hyfenCount = word1.Count(f = > f == '-');             if (!(dotCount < 6))             {                   MessageBox.Show("Invalid Email-id");                   return false;             }             else if (!(h

DataWare Housing

                           Data Warehousing A data warehouse consists of a computer database responsible for the collection and storage of information for a specific organization. This collection of information is then used to manage information efficiently and analyze the collected data. Although data warehouses vary in overall design, majority of them are subject oriented, meaning that the stored information is connected to objects or events that occur in reality. The data provided by the data warehouse for analysis provides information on a specific subject, rather than the functions of the company and is collected from varying sources into one unit having time-variant. Data warehousing professionals build and maintain critical warehouse infrastructure to support business and assist business executives in making smart business decisions. Warehouse ETL (Extraction, Transformation and Loading of data) is an essential part of data warehousing where the data warehousing profes

SQl Math functions

SQL Functions - Math Functions 1.ABS Function: SELECT ABS(-1) AS absolute; Output:- Output:1 2.Trig Functions The available trig functions are: ACOS ASIN ATAN TAN COS SIN Example of COS: SELECT COS(5.5) AS cosine; Output:0.70866977429126 Example of SIN: SELECT SIN(3.55) AS sine; Output:-0.39714816728596 Example of Tangent: SELECT TAN(3.5553) AS tangent; Output: 0.43904601857096 3.Two functions are CEIL and CEILING. Example of CEIL SELECT CEIL(5.35) AS roundedUp; Output:6 Example of CEILING: SELECT CEILING(5.35) AS roundedUp; OUTPUT:- 6 4.Floor Function Example: SELECT FLOOR(5.35) AS roundedDown; The output:5 5.Rounding The generic formula is: ROUND(X,Y) This states that we are going to round X to Y decimal places. SELECT ROUND(5.334333,2); The result is:5.33 6.Converting Radians to Degrees Example: SELECT DEGREES(0.4567) AS deg; Output:26.1669825036247 7.Conver