10 May 2008

Uploading Chinese Text to MySQL database

In SQL Server, if you want to insert Chinese or other language character to a table, it was pretty simple, just specify the column type as NVARCHAR, and when you insert you can just use "N'chinese text here" but I found out that there's no such thing as NVARCHAR in MySQL database and hence this article.

To insert Chinese character:

  • Specify database character-set as UTF-8

  • Specify table or column collation set as UTF-8

  • In your web.config connection string, specify charset UTF-8
    e.g. <add name="MySqlConnString" connectionstring="server=IPAddress;userid=mysqluser;password=pa$$w0rd;database=mydb;pooling=false;charset=utf8 "/>

    This is to tell the application to use UTF-8 charset when talking to the database

07 May 2008

MCPD ASP.Net 2.0 Web Developer

In order to get my MCPD Web Developer certification, I need to take 3 exams. Each exam has a few modules under it. For more details, refer to Microsoft website.

As I said previously, I'm taking the course from New Horizons Singapore and I'm going to write about my feedback about this course and the centre that I'm taking the course from.

I've taken the 2543 and 2544 modules, the module duration was 3 and 2 days each. Before taking the course, I thought I won't get any new knowledge but I was very wrong, there was many things that we don't use as a developer but MS Visual Studio 2005 actually offers much more features than I know.

There was many new knowledge that I received from this training that can actually make myself more productive as a programmer.

About the training centre itself, the facilities are not bad. The rooms are spacious so there are enough space for each students. The PCs are good quality in terms of size, speed, etc, it's good enough to support the training process, even though my screen turned pinkish a few times. The room they used for 2544 was better than for 2543, such that the chairs are better.. the first room's chairs were kinda wobbly at first I thought I might fall off the chair, but we all just got used to it after a while.

And there was a funny experience on the first day of module 2544, there was fire drill in the building so we all have to evacuate the place. I ended up walking around Tiong Bahru plaza, but it was quite early in the morning and all the shops were not even open yet!

Overall, this is a good experience so far :)

05 May 2008

DataGrid in ASP.Net 2.0

ASP.Net 2.0 has a new control to display tabular data which is called GridView. It's supposed to be more advanced than ASP.Net 1.1's DataGrid, but I personally prefer to use DataGrid when there are data manipulation to be done on the tabular data itself.

ASP.Net 2.0 supports DataGrid for backward compatibility purposes.

The reason why I don't really like ASP.Net 2.0 GridView is because it's difficult to do updating and deleting when the DataSource of the gridview is not an SqlDataSource, but just a simple dataset that you retrieve for the database.

A few problems that I encountered:

  • When I edit a column and click Update, it didn't get the value of the template column, instead it reads the default selected value of the drop down list

  • It couldn't easily get the controls in the row being updated



Maybe I'm too used to the old DataGrid but then again, people always say "If it's not broken, thn don't fix it" so I'm sticking to the DataGrid!

Don't get me wrong, the GridView also has a lot of advantages over DataGrid, just that for my own purposes, the DataGrid serves me better :)

19 April 2008

MCPD Web Developer

More information on this certification is available in Microsoft Website at http://www.microsoft.com/learning/mcp/mcpd/webdev/default.mspx. My company is sponsoring me to take the certification.

I'm going to take the course from New Horizons. This course is also endorsed by CITREP so if I pass the exam, they will reimburse portion of the course fee. I'm still not very sure how this CITREP works but the education consultant and my company HR are helping me up with this so I don't have to worry about it.

For more information about CITREP, you can refer to this website http://talent.singaporeinfocomm.sg/citrep.aspx

Since my course hasn't started, I can't comment on the quality of the education centre, so I'll post it after I finish the course.

02 March 2008

Connecting to MySQL Database from ASP.Net - Overview

I didn't think it was possible before. I thought only PHP can connect to MySql database. I was so wrong! The steps to connect to MySql database from ASP.Net 2.0 page is pretty simple (I didn't think so previously though), so let me share my experience here then.

There are a few steps to do this:

  1. Install MySql database
    You can install the Community version if you're not feeling rich.
  2. Install PhpMyAdmin or SqlYog or other softwares that can be used to administer MySql database
    I prefer SqlYog that PhpMyAdmin as it's simpler and easier to use, but still let me create my database, tables, columns, run my queries, etc. But if you're requirements are more complex, then maybe you'll need PhpMyAdmin.
  3. Install ASP.Net Mysql Connector
  4. Sometimes even after you install the connector, you still need to add the mysql.dll file to your bin directory (ASP.Net 1.1) or add reference in ASP.Net 2.0
  5. Write your code!

22 January 2008

An Introduction

I'm currently working at a US MNC in Singapore as Application Support Team Leader. While I'm more of a .Net enthusiast, I also do projects that are totally not related to .Net, like for example OpenText Livelink, which is a popular content/document management system, widely used in Europe and Americas.

My recent projects have revolved around ASP, Javascript, AJAX, XML/XSL, and the latest one has been Telligent Community Server. I'm looking forward to my company's direction to move to Microsoft SharePoint, too!

I'm also familiar with a few other programming languages and web design.

Feel free to contact me if you need an IT help!