Saturday, February 13, 2010

Global.asx

The Global.asx file is an optional file that contains code for responding to application level events raised by ASP.NET. This file is also called as ASP.NET application file. This file resides in the root directory of anapplication. If we are not defining this file in application, the ASP.NET page framework assumes that you have not defined any applicationa/Session events in the application.



Followign are the list of events handled in the global.asax file.

Event: Application_Start

When an application starts. This event occurs only one time in an application’s life cycle. It occurs again when you restart the application. It’s the best place to count number of visitors.

Event: Application_End

This event occurs when application ends.

Event: Session_Start

This event occurs whenever a new session starts. This is the best place to count user sessions for anapplication

Practical Usage: Setting user specific values, caching items based upon user context.

Event: Session_End

This event Opposite of the previous event.

Event: Application_Error

This event occurs when an unhandled error or exception occurs in an application.

Event: Application_BeginRequest

This event occurs every time when server makes a request. This event may occur multiple times in an applications life cycle.

Event: Application_End

This event occurs when an application closes

Friday, November 20, 2009

Change the Background Row Color of the GridView control using MouseEvents

By using this Article you can learn how to change BackGround Color of a Row in Gridview when user moves mouse on a particular selecting Row.

First Drag and Drop one Gridview Control on a webpage.After Retriving the data in a gridvew select your gridview and choose Events.In Events DoubleClik on RowDataBound.

after DoubleCliking on RowDataBound Event you will get a code in .aspx.cs as Below:


protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)

{

if (e.Row.RowType == DataControlRowType.DataRow)

{

e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='Silver'");

e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='green'");

}

}


How To change the address bar icon of your website

Introduction
This is Basically use to change the address bar icon of your website. steps for this.
Steps to Change Address Bar Icon:
(1) Create fevicon.ico file.
(2) Add these lines in the head tag of the page. if you have master page then add these lines in master page.
< rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
< rel="icon" type="image/x-icon" href="/favicon.ico">
(3) we are adding second line:
because for some browsers with the first line only it does not display your customize icon.

How to logoff,reboot,shutdown machine using javascrpt code

function Shutdown()
{
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("shutdown.exe -s -t 30 ");
}

just call above function whenever required.

-s: used for shut down
-t:time limitIn above code time limit is 30 second.It will show alert for 30 second that your machine is shutting down .use -l instead of -s for log off and use -r for reboot

Note :The “Initialize and Script ActiveX controls not marked as safe” option should be selected as “Enable”.Goto Tool Menu in browser ->Internet Option ->Security -> select Local intranet -> Click Custom Level ->go to "Initialize and Script ActiveX controls not marked as safe" and mark as enable. Do this otherwise it will show error automation server canot create object.

Thursday, November 19, 2009

How to find out all table details (table name, total rows in table, table size (in KB)) for any given database.

DECLARE
@DBTABLES
AS TABLE
(
SNO INT IDENTITY(1,1),
TABLENAME
VARCHAR(256)
)
INSERT INTO @DBTABLES
SELECT
table_schema + '.' + table_name
FROM
information_schema.TABLES
WHERE
table_type = 'BASE TABLE'
DECLARE
@DBTABLESINFO
AS TABLE
(
SNO INT IDENTITY(1,1),
TABLENAME VARCHAr(256),
ROWS char(11),
reserved varchar(18),
data varchar(18),
index_size varchar(18),
unused varchar(18)
)

DECLARE @COUNT
INT , @CURRENT INT, @TABLENAME VARCHAR(256)
SELECT @COUNT = COUNT(*) FROM @DBTABLES
SET @CURRENT = 1
WHILE (@COUNT >= @CURRENT)
BEGIN
SELECT @TABLENAME =
TABLENAME FROM @DBTABLES WHERE SNO =
@CURRENT
INSERT INTO
@DBTABLESINFO

EXEC sp_spaceused @TABLENAME
SET @CURRENT =
@CURRENT + 1
END


SELECT
TABLENAME,
ROWS,
DATA,
convert(bigint, left(DATA,len(data)-3) )
FROM
@DBTABLESINFO ---where TableName like '%_1'

ORDER BY 4 DESC

Wednesday, November 18, 2009

How to check details of Most Recent Backups and # of days since ANY type of backup on any SQL server

SELECT B.name as Database_Name, ISNULL(STR(ABS(DATEDIFF(day, GetDate(),MAX(backup_finish_date)))), 'NEVER') as DaysSinceLastBackup,
ISNULL(Convert(char(19), MAX(backup_finish_date), 100), 'NEVER') as LastBackupDate,
case
when type='D' then '** FULL **'
when type='I' then 'DIFFERENTIAL'
when type='L' then 'LOG'
end as Backup_Type,
case
when status > 16 then 'Check DB Status' -- Alert that DB might be ReadOnly, Offline etc...
else ' '
end as 'DB Status'
FROM master.dbo.sysdatabases B LEFT OUTER JOIN msdb.dbo.backupset A ON A.database_name = B.name --AND A.type = 'D'
where B.name not like '%skip these%'
GROUP BY B.name , a.type, status
ORDER BY B.name , LastBackupDate desc,a.type, status

Certificate in Software Function Point Estimation

The success of any software project largely depends on effective estimation of project effort, time, and cost. Estimation helps in setting realistic targets for completing a project. The most important estimation that is required to be fairly accurate is that of effort and schedule. This enables us to obtain a reasonable idea of the project cost.

If the effort and schedule estimates are inaccurate, it can impact the project cost drastically and result in the project being delayed. Therefore, before initiating a project, it is essential to know how long it would take to complete the project, what would be the development cost, and how many resources would be required. Using the process of effort and schedule estimation, we can calculate fairly accurate estimates.

Software size is an important input for estimating the effort, schedule, and cost of software. There are various methods and techniques available to estimate these factors.

Function point technique helps to estimates

Target Audience

  • Software engineers with 3 - 4 years of experience
  • Individuals who intend to grow as software project managers


Prerequisites

  • Experience
    • 3 - 4 years of experience in software industry
  • Education
    • Graduate or equivalent
    • Should have basic knowledge of
      • Software development lifecycle
      • Estimation concepts
      • Project management


Application Validity

Each application is valid for a period of One Year.


Recommended Reading

  • EdistaLearning Modules
    • ES101: Software Size Estimation using FPA
    • ES102: Software Effort and Schedule Estimation
    • ES103: Effort and Schedule Estimation using COCOMO II

  • Books and White Papers
    • Function point training booklets, Longstreet D.
    • Function Point Counting Practices Manual, International Function Point Users Group
    • Software Requirements and Estimation, Kishore S. and Naik Rajesh
    • Software Engineering Economics, Boehm, B.W.
    • Software Engineering - A practitioner's approach, Pressman, R.S.
    • Working Schedule Handbook, U. S. Army
    • COCOMO II Model Definition Manual, Center for Software Engineering
    • Software Cost Estimation with COCOMO II, Barry Boehm et al.
    • Measures for Excellence: Reliable


Format of Exam

  • Exam duration: 2 hours
    (Breakup of Duration: 40 min Objective, 40 min Subjective, 40 min Case study = 120 minutes)
  • Question paper consists of following sections:
    • Section 1 Objective: 40% weightage (40 questions)
    • Section 2 Subjective: 40% weightage (10 to 12 questions)
    • Section 3 Case Study: 20% weightage (2 question, 3 options would be provided to chose from)
  • Passing percentage
    • For each of the 3 sections: 60%
    • Overall percentage in certification exam: 75%