Wednesday, 29 January 2014

How to create Strore Procedure for Data Entry Form ( Save proceudre )


Procedure to Save Data and  Edit Data in Form
Alter PROCEDURE SaveEmployee
    @Id bigint,
    @Name nvarchar(50),
    @FatherName nvarchar(50),
    @MotherName nvarchar(50),
    @DesignationId bigint,
    @CompanyId bigint,
    @DepartmentId bigint,
    @DOB Date
AS
BEGIN
 if(@Id=0)  
 begin
       
    INSERT INTO Employee
    (
   
    Name ,
    FatherName ,
    MotherName ,
    DOB,
    DesignationId,
    CompanyId ,
    DepartmentId
    )
    VALUES
    (
 
    @Name ,
    @FatherName ,
    @MotherName ,
    @DOB ,
    @DesignationId ,
    @CompanyId ,
    @DepartmentId
 
    )
END
else

  BEGIN
UPDATE Employee
SET
Name=@Name ,
FatherName  =@FatherName,
MotherName =@MotherName ,
DOB = @DOB ,
DesignationId =  @DesignationId ,
CompanyId=@CompanyId ,
DepartmentId  = @DepartmentId
WHERE EmployeeId =@Id
END

 IF (@Id = 0)
BEGIN
SELECT  max(EmployeeId) EmployeeId FROM Employee
END

ELSE
BEGIN
SELECT EmployeeId FROM Employee
WHERE EmployeeId=@Id
END
    end

Tuesday, 21 January 2014

Friday, 17 January 2014

Why Asp.Net not Asp ( Classical Asp ) ?

ASP


·                     ASP has only  4 built in classes like Request, Response, Session and Application 

·                     ASP does not have server based components like button , textbox . we have to used  Html control.

Wednesday, 15 January 2014