Posts tagged: MySQL

Dec 08 2008

MySQL running under ASP.Net

With the status of the overall economy, I figured it would wise to research MySQL as a possible alternative to SQL Server for client development. It seems we all must do more with less, and MySQL being essentially free, it’d be worth checking out. 15Seconds does a great job explaining the install process of a new MySQL server. There are a ton of articles about the differences between SQL Server and MySQL and worth reading if you plan on implementing either in a production environment.

So I converted a Data Library that uses either MySQL or SQL Server based on the data provider you’ve specified in the web.config.

<connectionStrings>
<add name="MyDB"
connectionString="server=localhost; user id=uid;
password=pwd;
database=db; use procedure bodies=false"
providerName="MySQL.Data"/>
        </connectionStrings>

The library can execute and return datasets, datareaders, scalars and nonqueries using either Plain Text or Stored Procedures on either platform.

Dim dt As New Utilities.DataTools
dt.SetParam("?prm_ID", 0, ParameterDirection.Input, MySqlDbType.Int32, 1)
Dim ds as DataSet = dt.ExecSQLDataSet("
SELECT * From Table Where ID = ?prm_ID", CommandType.Text)
dt.Dispose()
dt = Nothing
MySQL - SQL Server DataTools

WordPress Themes