July 2009 Blog Posts

T-SQL copy and clone an existing table.

Something really useful that I like in Microsoft Access, is the capacity to select and clone an object just with a menu command. The options we have in access are: Structure only – will copy/paste into a new table the table structure, so the index, the primary key and so on. Structure and Data – will copy/paste everything inside a new table. Append – will copy the data into the existing cloned object. What can we do with SQL Server? Of course with SQL Server we cannot simply do that, especially...

UI Validation with the MVP pattern. Part #03

As we discussed in the previous posts, MVP UI Validation 01 and MVP UI Validation 02, thanks to the Microsoft enterprise library, we can easily handle a perfect and professional UI Validation without leaving the MVP pattern in our Client applications. Today I want to show you a final solution, that will handle in a professional way the UI validation. The basic validation, refractor process. In order to view what I am going to do today, you MUST read the previous articles related to the UI validation with the enterprise library. Actually we have our domain object...

Inversion of Control with NET Framework.

Today I want to break-out my series of posts about WPF to talk about an interesting design pattern. The Inversion of Control or Dependency Injection. You can find a clear definition at this address: Martin Fowler. What is it the Dependency Injection? The dependency injection is a way to inject some information and configuration inside an object, from another one. In this way we keep our object abstract and recyclable. As you can see in this example, we have two concrete tasks, and each one has an execute command that is exposed by the...

WPF and MVVM tutorial 07, the List search.

Ok, starting from this post we are going to do something really interesting. In this episode we need to create a simple List windows, but as you will see the logic will not be so different then a one-to-many form. This will be the final result: The ViewModel for the List Window. First of all we need to create the view model. The view model should have the following commands: New – Add a new Customer Save – Save all the changes we did … ...