Wednesday, September 26, 2007

ASP.NET AJAX Video Learning

URL: http://www.asp.net/learn/ajax-videos/

I'll take these as my coming lessons. Currently, there are 63 videos on different topics. I guess it's a good start to learn how to use ASP.NET AJAX.

Hopefully I will have persistence to learn all these video series this time. :p

ASP.NET AJAX is a set of technologies to add AJAX (Asynchronous JavaScript And XML) support to ASP.NET.

MyExpenseTracker Installer

Finally, I've compiled the setup file for MyExpenseTracker application. There are currently still a lot of issues that I'll need to fix later, or some features are not in yet. There are many things to learn for deployment phase too. I need to consider how to update the database for future version. :p

Feedback and suggestions are welcomed! ^_^

Downloads:
setup file: MyExpenseTracker BETA 1.0.0.zip (826.4KB)
source code (C#): MyExpenseTracker source code.zip (1.4MB)

After installation, you'll see this icon in your desktop.

  

Problems might be faced during installation:

1. If the program has been installed before, you'll get this error when you run the installation:

You have to go to Control Panel --> Add or Remove Programs to remove the program before you can install the new version.

 2. You may get the following error during the remove program process, perhaps the database log file is in use.

Right click on your taskbar --> select "Task Manager" --> click on "Processes" tab --> look for "sqlservr.exe" and click on "End Process". Then you can continue to remove the program before installing the new version.

 

3. You may encounter this error when you start the program.

You need to go to your "C:\Program Files\MyExpenseTracker\Data" folder and delete the "MyExpenseTracker_log.LDF" file. Then you can run the program again.

MyExpenseTracker - Almost Done

Finally, it's almost done! I've started this project since July, I thought it can be completed within one month, but... I just didn't really spend time doing it. Actually the core functions are there, just that I haven't really spend time fine tuning it, making the program more user friendly or nicer, and yeah, no error handling or input validation. haha~~ it's just very basic application now. At least, I can start using it to keep track of my expenses first. I really need to cut it off first, otherwise I'll be stuck here forever. haha~

Time to end this application, and move on to the next one now. Time to plan what's next. ^_^

Tuesday, September 25, 2007

Selecting Combobox item programmatically

Scenario:

I have added items to my combobox using combobox.Items.Add(obj), but when I set combobox.SelectedValue = selectedId, I still get null value in combobox.SelectedValue, though I've set combobox.ValueMember.

Solution:

Finally, I've found that ValueMember is respected only in data binding case only, whereas DisplayMember works in both cases -- Databinding and normal item addition.

In order to use SelectedValue, we need to bind the datasource to the combobox. Otherwise, we can use the following method to select the combobox item:

cboCategory.SelectedIndex = cboCategory.FindString(category);

FindString only search for DisplayMember only, but not ValueMember.


I guess the better solution is to do a databinding, but at the moment, I'll just use this alternative way of selecting items.