All posts in General .Net

Have you seen this? Check it out on codeplex !!!

The Microsoft All-In-One Code Framework is a free, centralized code sample library provided by the Microsoft Community team. The goal is to provide typical code samples for all Microsoft development technologies.

The team listens to developers’ pains in MSDN forums, social media and various developer communities and write code samples based on developers’ frequently asked programming tasks. Additionally, there is a free code sample request service you could take advantage in order to request specific code.

Check out the video…


1_thumb The data connection builder dialog is a database tool component that’s included in Visual Studio and helps you build a connection string to a database.

Last week though the standalone source code was published at http://code.msdn.microsoft.com/Connection/, so that anyone can use it to build a data con2_2nections independently of Visual Studio. According to the license, you can integrate and redistribute the source code with your application.

With the data connection dialog, you can perform following tasks:

  • Build/Modify connection strings.
  • Customize the data connection dialog.
  • Write your own custom data providers.

Nice!


You’ve probably seen or worked with a number of them, but here’s the complete and admittedly rich list of Shared Source Licensing programs for developers offered by Microsoft.


It sure is worth checking out.


In case you’ve didn’t notice Marin has posted a comment regarding my WPFSubsonic project and to be more precise a way I can read my application configuration file through my custom Visual Studio Tool. Now I just need to port it to my solution that supports the INotifyPropertyChanged interface and ObservableCollection class so that SubSonic Object can be bound to WPF controls.


Thanks Martin


I don’t know how many of you are interested or follow up on this effort. For those of you that do, I’m happy to say that the first release is very close.


The issue I still have to solve before publishing my code is the configuration one. Subsonic uses Web.Config to specify Database connection strings and the .Net 2.0 provider model to specify the Database drivers to be used. All these are configured in a custom configuration section that is read with a WebConfigurationSection descendant class at built time.


Since though custom build providers are not available at the Windows Forms platform I had to use another technique to emit the generated code in my programs. For this I decided to use Visual Studio Custom Tools following Dino Esposito’s article on MSDN Magazine. The problem with this implementation is that since your BaseCodeGeneratorWithSite class is registered as a COM object and created in Visual Studio’s scope, it has no longer access to types that could resolve the Custom App.Config Section (doesn’t know where to find the assemblies).


I’m thinking on putting the configuration section on the custom file that is passed on the BaseCodeGeneratorWithSite class as a parameter in the GenerateCode(string inputFileName, string inputFileContent) method. What do you think?


I had an accident last week, my Vista hard disk crashed L. Fortunately I didn’t lose any valuable (it has happened to me before so I now know better and keep backups of everything important) data but my Vista Installation was gone. So after getting a new hard disk and completing the system rebuilt I decided to import my Outlook data (yes I had a backup 😉 I only lost a day’s mail). When the restore process completed all of my mail and RSS Feed folders were successfully imported. Now I only had to import my OPML file to get back the 100+ feeds I’m following. Of course it didn’t occur to me that the OPML file does not keep any outlook folder information in it (dohh…), so the import process does not have a way to match the backed up folders with the imported feed accounts, thus when the Feed import completed I ended up having duplicate RSS Feed folders. At first I thought “OK I’ll select all folders, delete them (or move them to an archive folder), and then run the import again…” only to find out that you cannot multi-select Outlook folders!!! You have to delete them one by one!!!


But when you have to delete so many folders you start thinking if there could be another way you could achieve this deletion. And of course there is, Microsoft exposes an object model and API you can use in order to programmatically use its Office suite. Your program can then be hosted and perform the required action in an Office application as a custom Add-in. So I thought it would probably take me a little longer to develop an add-in that would delete anything under a specified folder but it could prove to be very useful and time saving through time. But why on earth would I want to delete all my feed folders, why throw away all those posts, wouldn’t it be better if I could instead match the folders with the imported RSS accounts? This could also prove useful if you have restored a hierarchical organized RSS feed folder collection which you would like to preserve.


I believe that the second idea is more useful than the first. What’s your opinion? Shall I give it a try? Which feed property would you use to discover the outlook folder to use?


I don’t know how long it’s been since I wrote my last Data Access Layer or piece of SQL Code, it certainly has been too long to even remember. Since then I’ve used a number of ORMs (Object Relational Mappers) or/and DAL Code Generators to perform all the tedious data access manipulation  I needed.


The ones I’ve used are
LLBGen : Unfortunately this free version stop evolving a long time ago (since .Net framework 1.1) and became a commercial solution,
Olero’s  ORM.Net : Which was my favorite Open Source (GPL Licensed) ORM, although it didn’t support Generics and all the nice stuff .Net 2.0 brought us.


Lately though I’ve been experimenting with SubSonic the zero code DAL as they call it and I must say I was Impressed with its simplicity, flexibility and extensibility. At last this open source ORM supported Generics and it was designed with .Net Framework 2.0 in mind. Then only problem was that it supported only ASP .Net 2.0 applications when I needed something that would not only be useful for Windows Forms Applications but something that could be used on Windows Presentation Foundation applications as well [with little or preferably no modifications].


So after studying and re-engineering the code, I’ve created a “fork” on Subsonic ‘s releases that will not only support Windows Form Applications but also the new INotifyPropertyChanged interface and ObservableCollection class of Windows Presentation Foundation so that I can easily bind data objects to my WPF forms.


I now have to do some testing before publishing the code and Officially announcing the release (using project’s codeplex space), so stay tuned if you’re interested…


I’ve been playing around with WinFx… sorry .Net Framework 3.0 for quite some time now and faced a number of issues with those early releases with the most irritating one being the crashing of Visual Studio 2005 when, while debugging an application, an unhandled exception occurred. It’s comforting to see though that most of the things that annoyed my in those early releases have already been resolved by the VS Team in .Net Framework 3.0 beta 2.


From Sotiris Filippidis’ Weblog a great collection library (C5) everyone should check out…