Be aware the environment when you built a .Net application
During this year, that is a transition period from 32-bit to 64-bit. That should not be a problem in .Net application. .Net should be CPU Neutral. But sometimes, some.net dlls will call others native dlls, such as SQLite and some SQL special types. They are only for either 32-bit or 64-bit environment. Thus, please be aware of this issue.
There is no ’ListItem’ in Winforms Combobox
I have been using ASP.Net for years. There is a very popup control, dropdown list. I used this control thousands of times. I know it very well. Recently, I built a winforms application. I need to use a dropdown list. ComboBox Control is the most similar with dropdown list. I found there is a different. I like to add a default option, new ListItem("Please select a type",""), into the items of the control. If the program will check whether the user selects this option, if that is the case, it will treat the input to be null. The items in ComoboBox is ObjectCollection. They are just a list of objects. You cannot use ListItem.
Well, you can create your version of ListItem objects and convert your domain objects into ListItem. Finally, you can bind the list of ListItem objects into the comobobox. In this way, Combobox will works like a drop down list.
I chose to use a simpler approach. I just created a domain object with ID 0 and insert it into the list.
Code
ResourceType empty = new ResourceType(); | |
empty.Name="---------------------------------------"; | |
resourceTypes.Insert(0,empty); | |
ddlSearchResourceTypes.DataSource=resourceTypes; |
WPF vs Winforms
I found I like Winforms Programming more. I felt that is easy to use. I can use TableLayoutPanel to create a complex UI. I know Grid in WPF can do a similar job, but I still think TableLayoutPanel is easier. Maybe, that is because I have been using WinForms for that many years! Moreover, I have experienced WinForms Application is faster. Thus, I like Winforms more.
Microsoft New SQL Server version ,"Denali" CTP3, is released
I got an email from Microsoft about new SQL Server version ,"Denali" CTP3, is released. I read their documents it got more support features in cloud. Moreover, its express version is more focus on localDB. This sounds like a in-process DB. That is very similar with sqlite. I have a look on that to how much improvements they have.
Click here to download from Microsoft
Reference:
SQL Server Code Name "Denali" Cloud On Your Terms
SQL Express
I got System.BadImageFormatException when I was using SQLite
I had built a new application using System.Data.Sqlite. When I run the application, I got an exception, System.BadImageFormatException.Well, I found I was using 64-bit version, because System.Data.Sqlite will call some unmanaged dlls. So, it still needs to be in 32-bit. After I changed to use 32-bit dll,then all goods. Or you can switch your build target to 64 bit and using 64 bit dlls.