Tuesday, 26 November 2013

How to Write a stored procedure for Optional Search

How to write a Stored Procedure for Optional Search? --Create Table create table stu_details(id int primary key identity,name nvarchar(30),class int)  --************************************************************** --insert record insert into stu_details(name,class) values          ('rahul',14),          ('Ramu',20),          ('Rahul',13),          ('rahul',14),         ...

How to Check a given number is prime or not?

How to check a given number is prime or not? ASPX page Code:- ------------------------ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="primeNumber.aspx.cs" Inherits="primeNumber" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">    ...

Saturday, 23 November 2013

What is the page life cycle ?

What is the page life cycle ?         1.   PreInit         2.   Init         3.   InitComplete         4.   PreLoad         5.   Load         6.   ControlEvents         7.   LoadComplete         8.   PreRender         9.   PreRenderComplete       10.   SaveStateComplete  ...

What is the Maximum Time Duration for session

What is the Maximum Time Duration for session? 365 X 24 X 60=525600 minute...

Thursday, 21 November 2013

SQL Query for interview purpose

ROW_NUMBER() --Use of row_number() function select row_number() over (order by id) as row,id from alltable Pivot -- Use of Pivot key word select id,stu_name,address,qualification from t1 pivot(min(value) for attribute in (stu_name,address,qualification)) t To show Duplicate Records --Create table create table dup(id int,name nvarchar(50),age int) --Insert Records insert into dup(id,name,age) values(1,'ramu',23),(1,'ramu',23),(2,'Shachi',30),(2,'Shachi',30),(3,'rahul gupta',20),(3,'rahul gupta',20) --Sql Query for...

Tuesday, 19 November 2013

Difference between Function and Stored Procedure

Difference between Function and Stored Procedure Function ü  It’s return only value which is mandatory. ü  Can have only input parameters. ü  Try-catch block cannot be used in a function. ü  We can’t use transaction management in function. ü  Function can be called in stored procedure Stored Procedure ü  It’s return zero or n values. ü  Can have input/output parameters. ü  Procedure cannot  be called from Function ü  Exception can be handle by try-catch block. ü  Transaction...