El lun, 25-08-2003 a las 03:17, Reggie Burnett escribi�:
> 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).

The code you gave me didn't compile in mono but it helps me a lot, with
some little modifications I get it to work:

string connectionString = 
            "Server=localhost;" +
            "Database=monotest;" +
            "User ID=mono;" +
            "Password=XXXXX;";
         
MySQLConnection conn = new MySQLConnection(connectionString);
MySQLDataAdapter da = new MySQLDataAdapter("select * from personas", 
conn);
DataSet ds = new DataSet();
da.Fill(ds, "personas");
//ds.Tables[0].Rows[0]["firstname"] = "Sergio2";
ds.Tables["personas"].Rows[0]["firstname"] = "Sergio2";
ds.Tables[0].Rows[2].Delete();

Console.WriteLine("{0}", ds.Tables[0].Rows[0]["firstname"]);
// now perform the update
MySQLCommandBuilder cb = new MySQLCommandBuilder(da);
da.Update(ds, "personas");


Thanks Reggie! Now I have a base from where I can learn :-)

-- 

[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

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmadadigitalmente

Reply via email to