New Domain Name
I have decided to buy a new domain name – agilechai.com. I think its a pretty cool name Related Reading: Head First Java, 2nd Edition Effective Java (2nd Edition) Java The Complete Reference, 8th Edition
Allow Visual Studio to use more memory in 32bit windows
Read this excellent guide on increasing the total memory Visual Studio can use, even in 32bit windows Related Reading: Head First Java, 2nd Edition Effective Java (2nd Edition) Java The Complete Reference, 8th Edition
How to completely disable ViewState and ControlState
Here is a code snippet that will COMPLETELY disable ViewState and ControlState. Please note, if you want to disable viewstate, you can set “EnableViewState” to false for the page, however you will still see “VIEWSTATE” in the page. The reason for that is because the hidden ViewState HTML field also contains “Control State”, which is [...]
The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse
I think this is a classic post that everyone should read: The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse Related Reading: Head First Java, 2nd Edition Effective Java (2nd Edition) Java The Complete Reference, 8th Edition
Annoying Nulls in SQLParameters
If you read Creating SqlParameters Best Practices you will find the fun you have if you have null values: SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@Required", required), questionCode == null ? new SqlParameter("@Code", DBNull.Value) : new SqlParameter("@Code", questionCode) }; Here is a nice helper function to deal with nulls without having to manually check [...]
ASP.NET 4.0 Features
Here is a list of new features in ASP.NET 4.0. Very interesting. Auto start feature, new ways to choose where data is cached, built in option for compression session (via gzip), and more! Related Reading: Head First Java, 2nd Edition Effective Java (2nd Edition) Java The Complete Reference, 8th Edition
Write .NET 3.5 in a .NET 2.0 World
Wow, sweet. Use .NET 3.5 features in .NET 2.0. A quick overview how to do it. 1. Edit your .CSPROJ file and manually add another reference to System.Core Add a True This will make the compiler copy it to the BIN folder. Thats it. You can now use .NET 3.5 features Related Reading: Head First [...]
Copy Data from One SQL Instance to Another
When using SQL Server Management Studio you might want to copy data from one DB to another (using just a SELECT and INSERT statement) It’s so easy you won’t believe it sp_addlinkedserver @server='192.168.123.456', @provider='SQLNCLI', @srvproduct='',@provstr='User Id=sa; Password=are-you-crazy-to-use-sa' insert into [192.168.123.456].MYDB.dbo.tblRecords select * from MYDB.dbo.tblRecords and when you are done sp_dropserver [192.168.123.456] References: sp_addlinkedserver on MSDN [...]
What is hnc.cgi ?
hnc.cgi is a spam script. Its also known as dm.cgi. If you have this script running, chances are your server has been exploited. Here is the actual dm.cgi script if you want to see it. Related Reading: Head First Java, 2nd Edition Effective Java (2nd Edition) Java The Complete Reference, 8th Edition
Changes in __doPostback in .NET 1.1 to .NET 2.0
Before and After If you manually want to simulate a postback, Here is how you would stick together a string manually calling __doPostBack in .NET 1.1 In this case its making a link in a particular linkbutton control inside a datagrid. __doPostBack in .NET 1.0 string link = "<a href=\"javascript:__doPostBack('dataGridCart$_ctl" + i + "$linkButton','');\""; __doPostBack [...]