Thursday 27 August 2009

MS SQL is too expensive


Hi,

Today's picture was taken by my daughter at the RHS Rosemoor in Devon last week. I love those big scary ferny things. They have large brush like flowers under all the leaves as well.

Spent much of yesterday researching how to become a "reseller" of hosting space. In other words, if I am going to write websites for people, I want somewhere to host their websites so I can keep an eye on them. I like ASP.Net and C#, which implies a Microsoft server and Ms SQL. There are lots of these around, some are very cheap. But ALL of the cheap ones have lots of truly scary reviews. Problem is, it looks like you have to pay a certain amount to Microsoft per MS database and there is no getting around that.

So why do I want it? MySQL is free and as far as I can see does the same job (is relational and all that). I can't use DotNetNuke but then I haven't yet managed to get that to run on my PC anyway. Looks like I can get a deal with a reputable host (for example 1&1 but it could be someone else) and use ASP.Net and MySQL (it runs on a Windows PC, it can run on a Windows server, surely?).

Ok, next step is how to connect to MySQL, the easiest way possible via Visual Studio 2008. I recommend this tutorial by Dr. Jay Krishnaswamy. This looks really lovely until you get to the part where you change the database type. MySQL just does not appear. The magic (and it took me ages to find this out) is on the MySQL website itself. Look through the downloads page (there aren't very many) and choose the latest stable connector for MySQL and .Net. This is an msi file. Scary though it is, I just downloaded it and let it do its stuff.

Next time I opened up VisStudio and had another go at configuring the data source, MySQL appeared in the list! After that it is all a matter of making sure your WAMP server is on and choosing the database and table you want. You also have to follow the above tutorial, to avoid errors (i.e, VisStudio does not like square brackets in SQL queries).

I now have a page which shows a gridview of a MySQL table on localhost. Next stop the external server!