[Mono-dev] Only works on MySql 4.1!?
Victor Romero
victor.tuxie at gmail.com
Sat Mar 4 15:07:56 EST 2006
Hi,
You can get more information about the Exception with something like
catch (Exception e){
//Your code
Console.WriteLine("Message Error " + e.Message());
Console.WriteLine("StackTrace Error " + e.StackTrace());
}
I have used the Connector .NET 1.0.6 and 1.0.7 with Mono 1.13.2 with no
problems on Linux (Fedora Core 3 and 4), Solaris 10 (Sparc), and Windows XP
Professional and with MySQL 4.0, 4.1 and 5.0.
You can look at the code that I use at
http://www.linux.ipn.mx/cms/space/El+Cartel+de+Tux/Mono+Pet+Shop
Please provide more information about the Exceptions :)
--
Victor Romero
Messenger: vic_romero at hotmail.com
Business Web Page: http://www.dsnibble.com.mx
Personal Web Page: http://linux.ipn.mx/cms/space/VictorRomero
Blog Web Page: http://elcarteldetux.blogspot.com
On 3/2/06, Paulo Augusto <PauloMorfeo at portugalmail.pt> wrote:
>
> I'm making a program in mono 1.1.13 using MySql.
> I am using the most recent version of the .NET connector dll, 1.0.7(?).
> I'm developing it in Linux with MySql 4.1.
>
> - When i went to test it in Windows, i installed MySql 4.0. Some inserts
> would never work.
> - I then installed the most recent version, 5.0.1(?). Now, the ones who
> were failing became working but some other insterts stopped working.
> - I went to try against a new instalation of MySql, this time 4.1,
> everything worked fime.
>
> All instalations on Windows were made with the default settings.
> I tried using the dll for mono, for .net 1.0 and .net 2.0. Apart from
> the 2.0 one who did not worked at all, the other 2 presented the exact
> same behaviour.
>
> Can anyone help me out trying to figure out what might be wrong?
>
>
>
>
>
> Here is the code i'm using to access the database:
> [code]
> ...
> ...
> comando= "insert into " + nomeTabela + " (" +
> colunas + ") values (" + conteudo +
> ");";
> return BD.ExecutarComando (comando);
> ...
> ...
>
> public static Retorno InicializarString ()
> {
> Retorno r= new Retorno();
>
> conectString= "Server=" + servidor +
> ";Database=" + baseDados +
> ";Uid=" + utilizador + ";Pwd=" + passe +
> ";";
> //"Encrypt=true;" "Allow Zero Datetime=
> true;Connect Timeout=15;"
>
> r.sucesso= true;
> return r;
> }
>
> public static Retorno ExecutarComando (string
> strComando)
> {
> if (conectString== "") InicializarString();
>
> MySqlConnection ligacao= new MySqlConnection
> (conectString);
> MySqlCommand comando= new MySqlCommand
> (strComando);
> Retorno r= new Retorno();
>
> comando.Connection= ligacao;
> try {
> ligacao.Open();
> } catch {
> r.sucesso= false;
> r.resultadoStr= Textos.ligacaoFalhada;
> return r;
> }
> try {
> r.resultadoInt= comando.ExecuteNonQuery
> ();
> ligacao.Close();
> } catch {
> r.sucesso= false;
> r.resultadoStr= Textos.comandoFalhado;
> ligacao.Close();
> return r;
> }
>
> r.sucesso= true;
> return r;
> }
> ...
> ...
> [/code]
>
>
> --
> The quick brown Firefox jumps over the lazy Internet Explorer!
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060304/0e7448bf/attachment.html
More information about the Mono-devel-list
mailing list