0 comments Friday, January 30, 2009

Ever wondered why is there no SQL server management studio after a successful installation of your SQL Server 2005? This is because by default the SQL 2005 installer does not install this tool. To install the studio just run "SqlRun_Tools.msi" from your setup disk. On enterprise edition, "SqlRun_Tools.msi" is located on D:\Tools\Setup. Below are some screenshots for administrator reference:

Location from CD:




Installation Options:



After running the SqlRun_Tools.msi, new items will be displayed on Microsoft SQL Server 2005 menu


Continue Reading...
0 comments Thursday, January 29, 2009

Adding session timeout on ASP.NET is straightforward and there are may ways to implement it. Today, I will discuss two (2) ways to do it:

1. Add sessionState entry on the web.config file



Or you can do the same thing using IIS Manager > Default Web Site > Properties > ASP.NET > EDIT Configuration.






Session Timeout Event on Global.asax

When user session times out it calls Session_End event and then when the user referesh the page again, it will create a new session and the Session_Start event is fired.


2. More control using Session objects

If you need more control on the session objects, you can create your own ID like the one below

Dim sessionid As Guid = Guid.NewGuid()
Session(sessionid) = sessionid.ToString

You can put this on you source page before redirecting to the page you want to monitor for timeouts. Example you can put in on a menu button as shown below:

Private Sub bntLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntPage1.Click
Response.Redirect("home.aspx")
End Sub

Then on your destination page, put the following code on Page_Init event.

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
InitializeComponent()
CheckSessionTimeout()
End Sub

Private Sub CheckSessionTimeout()
If Session("sessionid") Is Nothing Then
Response.Redirect("login.aspx")
End If
End Sub


Continue Reading...