[Mono-list] DataSets + MySQL

Reggie Burnett rykr@bellsouth.net
Sun, 24 Aug 2003 20:17:33 -0500


If you are using the ByteFX provider, the following code will update (check
for compile errors) from a dataset.  This will work on .NET but I have not
run code like this on Mono but it should work (or be very close anyway).

MySqlConnection conn = new MySqlConnection("..connecion string here..");
MySqlDataAdapter da = new MySqlDataAdapter(da, "select * from mytable");
DataSet ds = new DataSet();
Da.Fill(ds, "mytable");
Ds.Tables[0].Rows[0]["mycolumn"] = "myvalue";
Ds.Tables[0].Rows[3].Delete()

// now perform the update
MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
Da.Update(ds, "mytable");  

For further info you can use the MSDN docs on the SqlClient data provider as
the two work the same.  Simply use the classes found in the
ByteFX.MySqlClient namespace.

Reggie


> -----Original Message-----
> From: mono-list-admin@lists.ximian.com [mailto:mono-list-
> admin@lists.ximian.com] On Behalf Of Sergio Blanco Cuaresma
> Sent: Sunday, August 24, 2003 7:00 PM
> To: mono-list@lists.ximian.com
> Subject: [Mono-list] DataSets + MySQL
> 
> Hi,
> 
> Does somebody have some example showing how to connect to a MySQL using
> DataSets ? Is it currently supported by mono?
> 
> Thanks!
> 
> --
> 
> [aka Marble]
>  Registered LiNUX user #140941  <>  http://counter.li.org/
>  Socio #3274 de HispaLinux  <>  http://www.hispalinux.es
>  Miembro de GPL URV  <>  http://www.gplurv.org
>  GnuPG key: 0x0ED2CF9D  <>  pgp.escomposlinux.org