Yet another coding blog covering everything from C#, WPF, SQL, and Silverlight to any other random thought that passes my way…
RSS icon Home icon
  • New project almost ready…

    Posted on October 31st, 2009 biggert No comments

    Working on a new project that’s got a little more umph than the SQL script… a quick, small little WPF-based utility that can help with resizing delimited text files. This idea came out of a need, especially in my field of work, where delimited text files need to be altered and columns be removed yet the size/row limitation(s) of the most common CSV editor (Microsoft Excel) hinder this greatly. Anywho, I hope to have this project (free) out there by the end of November and hopefully have the source code out there by the end of the year. Happy Halloween.

  • Visual Studio keyboard shortcut to apply uppercase/lowercase to selection

    Posted on October 29th, 2009 biggert No comments

    So I’ve been doing this for a while manually (especially considering the performance benefit of UPPERINVARIANT over LOWERINVARIANT)  but recently took the time to Google and see if there’s an automated way to do this and alas, there is. Google sent me to Sara Ford’s blog where it mentions the shortcuts.

    • Press Ctrl+Shift+U to make the current character or selected characters uppercase
    • Press Ctrl+U to make the current character or selected characters lowercase

    Good to know!

  • Can’t figure out how to implement a custom IDataReader to my collection

    Posted on October 22nd, 2009 biggert No comments

    I hope someone can help me here… I’ve been working on this for 4 days now with barely any luck.

    Here’s the question:

    I know it is possible to create a custom datareader (inferring from the IDataReader interface) which accesses the data in a collection. I’ve seen it used in other third-party controls and am wanting to do it myself. I’ve come across an ancient (2004) website of how a guy explains how to do it (http://blogs.msdn.com/yvesdolc/archive/2004/11/08/254209.aspx) but I am having difficulty implementing his code since he did not provide examples and 2004 C#/.NET2.0 might not be as performance-tuned as the latest and great C#/.NET3.5. Can anyone assist me in either providing some samples on how to do this or providing some sources that can teach me how to do this. I’m googled up and down on a tutorial on how to write a custom datareader but everything I find isn’t very helpful… it either lists code that’s already complete without good information of how they got there or has code that doesn’t do what I need it to do.

    Just to make it easy, I’ve included an example collection in the code so that, if examples are provided, they can reference it.

    NOTE: Just an additional item, if this can be generic-ized in a way to support different types of collections, that’s a huge plus!

    public class Person
    {
         public int ID {get; set;}
    
         public string Name {get; set;}
    
         public string Gender {get; set;}
    
         public Person()
         {
    
         }
    
         public Person (int id, string name, string gender)
         {
    
              ID = id;
              Name = name;
              Gender= gender;
         }
    }
    
    public class People : List
    {
         public People { };
    }
    
    public void Main()
    {
         Person person1 = new Person(1, "John Doe", "Male");
         Person person2 = new Person(2, "Jane Smith", "Female");
         Person person3 = new Person(3, "Tom White", "Male");
    
         People peeps = new People();
    
         peeps.Add(person1);
         peeps.Add(person2);
         peeps.Add(person3);
    
    }
    

    UPDATE (10/29/2009): Well, I figured out a way to get his code and it was well worth the effort as I noticed an increase in performance (as well as a significant decrease in MEM usage) when using his datareader over converting to a datatable. I’m busy coding away at it and I having yet figured out how to keep it as generic as I’d like but his code works well for now. I’ll post the solution (using his code) at a later date so everyone can see. It’s actually quite simple….

  • Multi-process and multi-threaded debugger issues (VS2008)

    Posted on October 8th, 2009 biggert No comments

    I recently got an email from a coworker about a new (well, new to me) hotfix for VS2008. We’ve been working on a heavily multi-threaded application and apparently all have had issues regarding both debugger breakpoints and using “step into” when running the VS2008 debugger. As common as I’ve seen this in my environment and obviously it is happening in his too, just thought I’d post it out there on the web so others could enjoy a somewhat correctly functioning debugger for multi-threaded processes.

    Basically, in my environment, VS2008′s debugger would simply ignore some breakpoints when multiple threads were flying around.

    Enjoy!

    This explains the problem:
    Updates for Visual Studio 2008 SP1 debugging and breakpoints

    This gives a link to download the hotfix:
    KB957912 – Update for Visual Studio 2008 SP1 Debugging and Breakpoints

  • Deleting Ghost PSTs in Outlook 2003

    Posted on October 5th, 2009 biggert No comments

    Had to give a shout out to www.outlooktips.com for helping me with my latest problem. Due to some testing of some code based around the third-party library named Outlook Redemption, I had a few “ghost” PST folders left around in Outlook. I’ve had this in the past and the best solution out there was to literally remove the mail profile and add a new one. Because my current profile consists of an incredibly large exchange account (I’ve taken the Gmail approach where I archive messages instead of deleting) and I did not want to redownload all those darned emails… so I found this link: Delete Ghost PSTs by Editing the Registry. Crisis averted! One note that I wanted to add though is that this tells of searching for 001e3001 in the registry to find the name… my names were actually stored in 001f3001. Luckily the name in my particular case was easily identifiable so once I deleted the key, the folder was gone.