This isn't T-SQL. Looks like C# to me, and there's nothing database related in there. You may get better and faster replies posting this pn a C# forum, maybe one of the MSDN ones? http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass