Monday, March 26, 2007
The coolest log parser
Wednesday, March 14, 2007
Waiting in SQL 2005
Have you ever needed to wait in a stored procedure? Well here is how. Declare @Counter as int
Set @Counter = 0 while @Counter < 3 BEGIN print @Counter Set @Counter = @Counter + 1 WAITFOR DELAY '00:00:02' -- waits for 2 seconds before next line is executed. END
Thursday, March 8, 2007
ASP.Net Custom Server Control Lessons
protected
override void OnLoad(EventArgs e) { // do "rendering here" if you need to change values on the page i.e. raising an event ControlOutput = "<span>Hi</span>"; } protected override void Render(HtmlTextWriter output) { output.Write(ControlOutput); }
If you want to reproduce something link a LinkButton you will need to implement IPostBackEventHandler. This works in conjunction with __doPostBack() method.
Page.ClientScript.GetPostBackEventReference(this, "MyActionNameHere"). To learn more about this, check out the ASP.Net QuickStart
Wednesday, February 28, 2007
Events not showing up in EventLog
- If deploying in IIS 5 (for example: Windows XP Professional) Give the ASPNET account Full Control.
- If deploying in IIS 6 (for example: Windows Server 2003) Give the NETWORK SERVICE account Full Control. NOTE: If running your application pool under a different user than NETWORK SERVICE, then give that user account Full Control instead of NETWORK SERVICE. This is the user that the process will run under.
Tuesday, February 27, 2007
Java Application Server start and stop manually
Starting the Java Application Server that comes with Java Studio Enterprise 8 by running the start-domain is not recommended due to parameters that are expected by the batch file. Consequently the batch file hangs.
To properly start the Java Application Server, open a command prompt and type:
Asadmin start-domain
To properly stop the Java Application Server, open a command prompt and type:
Asadmin stop-domain
Thursday, February 22, 2007
.Net Caching Rocks!
Wednesday, February 21, 2007
SQL 2005 ROW_NUMBER()
SQL Server 2005 no makes it easy to do paging of results and every n rows queries now that the row number can be obtained without using a temp table.
The new functionality is given by ROW_NUMBER(). Here is an example that returns every other row regardless if rows have been deleted, missing pks in the sequence, etc:
select Employee_number, myrownum from
(
select
Employee_number,
row_number() over (order by sc.FIRST_NAME asc) as myrownum
from
person
) as temp_person
where
myrownum % 2 = 0
order by myrownum asc
NOTE: the LAST line it is very important if you want to see the rows returned in the order of the row numbers.