April 2008 - Posts

0
Comments

Type Inference in Generics by zhirani

If you are using generic method, you can call the method without explicitly specifying the type arguments. Their are certain cases where the compiler cannot infer the type based on the values passed in the parameters, in those cases you can explicitly...
1
Comments

Linq to SQL Debug Visualizer by zhirani

I have been learning Linq for sometime. However I always had some difficulty figuring out what SQL statement got generated for my Linq query. Although there are numerous ways to find the SQL statement that get generated but none of them were with out...
2
Comments

How To Find Which Control Raised PostBack by zhirani

There are times in asp.net when I really want to know which control in the page raised caused the page to post back. An easy way to find this is to register an event with the control that raises PostBack and cast the sender property to the appropriate...
1
Comments

Delay Loaded Property by zhirani

I recently discovered while playing with the linq OR designer that each property on a class has a property called DelayLoaded. It allows you to delay the loading of that column from the database until the user accesses that property on the object. Only...
0
Comments

Creating Private Auto-Implemented Property by zhirani

I have been using auto implemented property for a while but did not know that you can control the acessor for getter and setter. Basically I can use public at the property level and set private or protected at either getter or setter. I cant set acessor...
1
Comments

Comparing Anonymous Types by zhirani

C# 3.0 allows you to create anonymous types which is basically a handy way to use a class without defining a class. It is really a nice feature when you are building linq queries which does not return fixed number of columns depending on the query you...
0
Comments

Using Default Values in Generic Method by zhirani

There are times when you want to assign default values to your variables. For instance if you have a reference type variable the default value will be null. If it is a value type you could assign 0. But how do you check in a generic method if the value...
0
Comments

How To Use Profiler with Linq To SQL Queries by zhirani

SQL Profiler is one of the very good tools from SQL server products tools that can help you evaluate the kind of SQL statements Linq to SQL is sending to the database. Although datacontext provides you with a log property that allows you to output the...
5
Comments

How To do In and Like clause in Linq To SQL by zhirani

In clause is one of the common querying feature we use in SQL. But there is no clear explanation of how to write a Linq query which allows you to filter the results based on certain items in a list. Well after digging in through some of the query operators...
0
Comments

vacation time!! by zhirani

Ok guys, I am going on vacation for a week. Not sure if i would get time or enough strength to come back at night and write something from my hotel room. Yeah i am taking my laptop on vacation, i just can't stay away from computer for too long. I haven...
Filed under:
More Posts Next page »