|
I was a big SQL Server fan for a long time, that was until I discovered MySQL. A free database engine that is comparible to MS SQL Server?! You bet! I switched this website that you are browing to MySQL and I love it. No extra fees, easy to use, easy to setup, whats not to love. My journey began with this article on 15seconds.com. If you follow the steps for setting up your server and using the MySQL Administrator you'll be up and running in no time. However the article doesn't cover some pitfalls that I've experienced. In a nutshell these are:
- When using parametered queries you must use a '?' instead of a '@' like this:
Using comm As New MySqlCommand("Select Name from Categories where ID = ?ID", conn)
comm.Parameters.AddWithValue("?ID", ID)
Try
conn.Open() str = comm.ExecuteScalar()
Catch ex As MySqlException
_SqlEx = ex
Finally
conn.Close()
End Try
End Using
- If you want to be able to browse your MySQL database in VS.Net you need to download the plugin here.
- In your project you must add a reference to the MySQL data driver. This driver is located in the C:\Program Files\MySQL\MySQL Connector Net 5.0.8.1\Binaries\.NET 2.0 folder.
I hope some of this has been helpful to someone out there. If so let me know. Thanks.
|