Wednesday, February 04, 2004 - Posts

.NET framework and the Provider Model

To get up to speed read this first

I hope in future there will be a possibility to extend .NET similarly in other places like the System.Web.UI.Webcontrols namespace.

Suppose like an ISP or a corporation could replace the default namespace ith an inhouse-built or open source or commercial package to enhance security or logging or pretty colors by swapping the provider in machine.config for a whole webserver and all it's sites.

And it would save me from doing this

A break from Tech

After some grueling but satisfying hours of work there is nothing that I like better than entertain my friends
with food and drinks.
Last night was one of those. it happened accidentally, where my gf (and wife to be ) came home with some work colleagues of the "high fashion" world and I had a couple of us engineers in the house. Although different , we all
mixed well and it turned out to be one of those nights till 5 AM

What's locking my database process?? (Which page/user are locking my DB?)

1) set the default (Application Name= ) part of the connectionstring to a string composed of user and pagename

2) get the data from Sysprocesses tables out of SQL Server/Sybase into a grid on your page

3) Kill relevant process (SPID) through sproc or manually on Enterprise Manager

Not all spid are killable, contact your DBA. He knows what's best

Check your ASP.NET uptime !!

run following in the Page_Load  

  Sub bindGrid()
        Dim history() As ProcessInfo = ProcessModelInfo.GetHistory(100)
        Dim i As Int32 = 0

        Dim dt As New DataTable()
        Dim dr As DataRow

        dt = New DataTable()
        dt.NewRow()
        dt.Columns.Add("inception")
        dt.Columns.Add("pid")
        dt.Columns.Add("status")
        dt.Columns.Add("age (sec)")
        dt.Columns.Add("requests")
        dt.Columns.Add("lamentation")
        dt.Columns.Add("peak_memory")

        For i = 0 To history.Length - 1
            Dim obj() As Object = {history(i).StartTime, history(i).ProcessID, history(i).Status.ToString(), history & _(i).Age.TotalSeconds, history(i).RequestCount, history(i).ShutdownReason.ToString(), history(i).PeakMemoryUsed()}
            'new row
            dr = dt.NewRow()
            ' put in the data
            dr("inception") = history(i).StartTime
            dr("pid") = history(i).ProcessID
            dr("status") = history(i).Status.ToString()
            dr("age (sec)") = history(i).Age.TotalSeconds
            dr("requests") = history(i).RequestCount
            dr("lamentation") = history(i).ShutdownReason.ToString()
            dr("peak_memory") = history(i).PeakMemoryUsed()
            dt.Rows.Add(dr)
        Next

        dgrAspProc.DataSource = dt
        dgrAspProc.DataBind()

    End Sub