Geeks With Blogs
Ben Bastiaensen Living the .NET live September 2009 Entries
Extension Methods
Ever got bored of typing the same code over and over again? For example, if you want to use the IDataRecord to process a DataReader you will run into this code a lot: s.Id = objIDR.GetInt32(objIDR.GetO... s.Name = objIDR.GetString(objIDR.Get... Over and over again you need to call the GetOrdinal function to get the index of a field in the IDataRecord. You can reduce your typingwork a lot by using Extension Methods. They will encapsulate the GetOrdinal function into a new ......

Posted On Thursday, September 24, 2009 8:41 AM

Copyright © Ben Bastiaensen | Powered by: GeeksWithBlogs.net