Getting started with mySql

Discussion in 'Databases' started by gid2, Jun 1, 2013.

  1. MySql has the big advantage over Sql Server that its cheaper, and so I started trying it out.
    I found that you cannot use a gridview with a sqldatasource (as far as I know), but you can use it with an objectdatasource. A great explanation is at:
    http://www.codeproject.com/Articles/14110/MySQL-5-C-sample-code-using-ObjectDataSources
    In fact, you can do things with objectDataSources that you can't do with sqldatasources. You can add fields, such as (in my case) a boolean called "isLast" which indicates which record is the last, or even adding a consecutive numbering field.
    In addition, you should get hold of the latest connector library from:
    http://dev.mysql.com/
    This will give you the MySql.Data.dll library. You can install it on your local PC, then do a FIND to find what folder it is in on the PC, and ftp it to the BIN folder of your discountasp.net website.
    In your code-behind page, you can put (if you are using VB):
    Imports MySql.Data
    Imports MySql.Data.MySqlClient
    and the rest of the code is analogous to sql server code, with parameters, commandobjects and mysql data types.

    One final note: you get your connection string from the manage mySql page on your control panel

    So far, MySql is doing everything I need for my latest site. There may be a problem with null dates, but I'm investigating that at the moment.
    -- Hope this speeds up those of you trying out mySQL
     
  2. tasha

    tasha DiscountASP.NET HBIC

    Thanks for the info!
     

Share This Page