<asp:RegularExpressionValidator ID="rgvClientCount" runat="server" ControlToValidate="txtClientCount"
                                ValidationExpression="^[1-9][0-9]{0,7}$" ErrorMessage="Numbers Only! (1-9999)"
                                Display="Dynamic" SetFocusOnError="true" ValidationGroup="Submit" />

UPDATE    Patient
SET    Patient_Area = Area.Area_Desc --etc
FROM    Patient
    JOIN
    Area ON Patient.Patient_Area=Area.Area_Id

USE [RiskCurve]
GO
/****** Object:  StoredProcedure [dbo].[CatchError]    Script Date: 02/09/2012 17:17:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*********************************************************
 Procedure Name: CatchError
 Version:        1.0
 Purpose:       This procedure is used to save ERROR LOG .                                                        
 Input:            Many peramnetrs
 Default value: None                                                                                  
 Output:       
 Returns:       
 Dependencies: 
 Tables:        Request
 Procedures:    No
 Created By:    Pradeep Kumar
 Created Date:  19-MAY-2011
 Checked by & Date:                                                              
 Modifier & Date:
 Modification Description:
 Modification Purpose:
 Limitations/Restriction:
 Algorithm:
 *********************************************************/


ALTER PROCEDURE [dbo].[CatchError]   
AS

BEGIN
   
    --To keep the error message
    Declare @ErrMsg as varchar(1000)
   
    BEGIN TRY 
       
        INSERT INTO dbo.Error_Log(Error_Date,Error_Msg,Error_Number,Error_Source )
        SELECT DATEADD(HOUR, 20, GETDATE()), ERROR_MESSAGE() ,ERROR_NUMBER(), ERROR_PROCEDURE()


    END TRY 
 
    BEGIN CATCH 
    
    END CATCH
   
    set @ErrMsg = ERROR_MESSAGE()
   
    Raiserror(@ErrMsg -- Error Message
        , 16 --Severity Level
        , 1 --State
        )

END
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtMobile"
                                                    ValidationExpression="^[0-9]{10}" ErrorMessage="*" Display="Dynamic" ValidationGroup="Submit">
                                                </asp:RegularExpressionValidator>
function checkDouble(evt, strValue) {
    var iKeyCode = (evt.which) ? evt.which : event.keyCode;

    //if( iKeyCode <= 46 || iKeyCode > 58 || iKeyCode==47)
    if (iKeyCode <= 46 || iKeyCode > 57 || iKeyCode == 47) {

        // handle "." case
        if (iKeyCode == 46) {

            var is_dot = strValue.indexOf('.');
            if (is_dot == -1) {
                return true;
            }
            else {

                iKeyCode = 0;
                return false;
            }
        }
        else if (iKeyCode != 8 && iKeyCode != 13 && iKeyCode != 9) {
            //alert(iKeyCode);
            //iKeyCode= 0;

            //alert("Please enter Numeric or Decimal value");
            return false;
        }
        else if (iKeyCode == 8 || iKeyCode == 9) {
            return true;
        }
        else {
            iKeyCode = 0;
            return false;
        }
    }
    return true;
}

function checkInteger(evt, strValue) {
    var iKeyCode = (evt.which) ? evt.which : event.keyCode;

    //if( iKeyCode <= 46 || iKeyCode > 58 || iKeyCode==47)
    if (iKeyCode <= 47 || iKeyCode > 57 || iKeyCode == 47) {

        if (iKeyCode != 8 && iKeyCode != 13 && iKeyCode != 9) {
            //alert("Please enter Numeric or Decimal value");
            return false;
        }
        else if (iKeyCode == 8 || iKeyCode == 9) {
            return true;
        }
        else {
            iKeyCode = 0;
            return false;
        }
    }
    return true;
}

Types of Inheritance in C#.NET



Creating a new class from existing class is called as inheritance.

Inheritance with Example

Inheritance can be classified to 5 types.

  1. Single Inheritance
  2. Hierarchical Inheritance
  3. Multi Level Inheritance
  4. Hybrid Inheritance
  5. Multiple Inheritance
1. Single Inheritance

when a single derived class is created from a single base class then the inheritance is called as single inheritance.


Single level Inheritance


2. Hierarchical Inheritance

when more than one derived class are created from a single base class, then that inheritance is called as hierarchical inheritance.

Hierarical Inheritance


3. Multi Level Inheritance

when a derived class is created from another derived class, then that inheritance is called as multi level inheritance.

Multi level Inheritance


4. Hybrid Inheritance

Any combination of single, hierarchical and multi level inheritances is called as hybrid inheritance.


Hybrid inheritance in C#


5. Multiple Inheritance

when a derived class is created from more than one base class then that inheritance is called as multiple inheritance. But multiple inheritance is not supported by .net using classes and can be done using interfaces.

Multiple inheritance in C#


Handling the complexity that causes due to multiple inheritance is very complex. Hence it was not supported in dotnet with class and it can be done with interfaces.