[Mono-list] Moving from SQL Server to MySQL

Dave Searle dave@davesearle.co.uk
Fri, 17 Jan 2003 10:01:37 -0000


I would personally keep SQL Server running on a Windows box somewhere.
mySQL is lacking in very important database parts such as stored
procedures which probably won't get incorporated until version 5.0! This
depends of course though how you've written your database layer (ie SQL
in the code or SQL in the database). I think SQL server can be used from
mono anyway, but I'm no expert on the matter.

Good luck!

Dave

-----Original Message-----
From: mono-list-admin@ximian.com [mailto:mono-list-admin@ximian.com] On
Behalf Of Gabriel & Emily Bin
Sent: 16 January 2003 23:52
To: mono-list@ximian.com
Subject: [Mono-list] Moving from SQL Server to MySQL


Hey, this is my first post to the Mono list!  I'm totally stoked about
this project.  As a recent convert from windows to Linux, I'm totally
stoked about moving our in-house apps over to run on Linux boxes.  All
our apps are being re-written in C# or VB.NET.  Currently all systems
are running windows, from the clients to the server.  Switching the apps
over to Linux shouldn't (if the promise of Mono pans out - I'm crossing
my fingers) be that big of a deal.

We are starting a new web app and are trying to migrate databases from
SQL Server to MySQL. I'm still a little unclear about how that might be
done.  I 've come up with the following solution and was wondering if
anyone with experience in this area might help me before we write tons
of code based on a hope alone.

This is what I've com up with:
(based on what I read at
http://lists.ximian.com/archives/public/mono-list/2003-January/004903.ht
ml)

I could use a function whenever I needed a connection object.  The key
is using System.Data.IDbConnection as an interface between the different
types of connection objects (SQL and MySQL).


***** Start
Imports System.Data
Imports System.Data.SqlClient
Public Module DataLayer
    Public Function BizConnection() As
System.Data.SqlClient.SqlConnection
        Dim dbcon As IDbConnection = New SqlConnection()
        Return dbcon
    End Function
End Module
***** End


Then I could work with the SqlConnection just as I would at any other
time.


***** Start
Dim scon As SqlConnection = DataLayer.BizConnection()
***** End


When we change the database we could then change the module.


***** Start
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Mono.Data.MySql
Public Module DataLayer
    Shared Function BizConnection() As SqlConnection
        Dim dbcon As IDbConnection = New MySqlConnection()
        BizConnection = dbcon
    End Function
End Module
***** End

Would this work?  I'd test it but we can't wait around to set up a MySQL
server and get Mono running etc.

Any feed back would be great.

Gabriel

_______________________________________________
Mono-list maillist  -  Mono-list@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list