The simplest way to do this is via MySqlCommand.ExecuiteNonQuery:
public int ExecuteNonQuery( string sql ) {
int ret = -1;
MySqlCommand cmd = new MySqlCommand();
try {
cmd.CommandText = sql;
cmd.Connection = Connector.Connection;
ret = cmd.ExecuteNonQuery();
}
catch ( MySqlException ex ) {
this.ErrMsg( ex );
}
finally {
cmd.Dispose();
}
return ret;
}
Last updated 16 Aug 2024 |