CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of sqlDataReader
C#
public static IList<T> ToList<T>(this System.Data.SqlClient.SqlDataReader dr) where T : new()
       {
           Type type = typeof(T);
           if(System.Web.HttpContext.Current.Cache[type.Name + "_properties"] == null)
           {
               System.Web.HttpContext.Current.Cache.Insert(type.Name + "_properties", type.GetProperties().ToList());
           }
           IList<PropertyInfo> properties = (IList<PropertyInfo>)System.Web.HttpContext.Current.Cache[type.Name + "_properties"];
           IList<T> result = new List<T>();
           while(dr.Read())
by ofer   September 25, 2011 @ 3:18am
174 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate