Sandip's Programming Zen

An attempt to share tech/coding experiences

Low cost of ownership – ASP.Net with MySQL

leave a comment »

Recently we shipped one Asp.net solution to our client with backend as MySQL.

Why we chose MySQL as backend, well the biggest reason is Cost of ownership to the customer, normally we use MS SQL but owning or renting it costs high to the customer (especially when they plan to host in-house). Using MS Access as backend is not recommended for enterprise scale applications. MySQL is almost free as well as a proven-reliable Database solution.

Here how we did it:

  • Installed latest MySQL 5.0.5 server release on Windows 2003 R2
  • Installed MySQL ODBC connector for Win32 platform. Yes, you have to use ODBC to connect to database.
  • Created System DSN using MySQL ODBC connector.
  • Changed our data connector class code, using Data.ODBC library instead of Data.SQLClient
  • Changed our sql queries little bit to adjust with MySQL, believe me there are no major difference in syntax, the most obvious difference you will see is in this syntax (example MS SQL: select top 1 * from table 1 MySQL: select * from table 1 limit 1).

It was fairly easy because we have hardly used stored procedures and most of our database transactions are handled through in-line queries. I believe using in-line queries are way to go if you making applications supporting multiple database.

If readers have specific questions then they can write to me, we will be happy to share our experiences on this.

In my next post I will write how we migrated a Live MS SQL database to MySQL.

Advertisements

Written by Sandip

February 15, 2008 at 4:51 pm

Posted in .Net

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: