[Mono-list] Mono/odbc passing invalid chars to MySQL DB

Daniel Lo Nigro lists at dan.cx
Wed Sep 12 23:57:38 UTC 2012


Interesting that it compiles the code on the fly...

Can you add new assembly references somehow? If you can add a reference to
the MySQL DLL, you should be able to replace your usage of
System.Data.Odbc.OdbcConnection
with MySql.Data.MySqlClient.MySqlConnection. Otherwise, another option is
to use a DbProviderFactory. You should be able to edit the application
config file (I think it's called something like appname.exe.config) to add
the MySQL factory to it. See
http://msdn.microsoft.com/en-us/library/dd0w4a2z%28v=vs.100%29.aspx

In any case, you'd have to change all your ODBC clases to the corresponding
generic class (eg. OdbcCommand to DbCommand)


On Thu, Sep 13, 2012 at 12:34 AM, BadRobot <robster400 at gmail.com> wrote:

> The software is limited to odbc I believe, although, as a layman, don't
> take
> my word on that...
>
> I've  uploaded the source for the plugin, remember that its compiled on the
> fly at launch by the Procon application itself, and I am unable to supply
> any build flags (unless I'm overlooking something) for the plugin as
> suggested in
> http://dev.mysql.com/doc/refman/5.1/en/connector-net-installation-unix.html
>
> http://paste2.org/p/2215522
> the Connection strings are around line 2791
> http://paste2.org/p/2215522#line-2791
>
> I am unsure if anything can be modified to adapt to using the .net
> connector
> & the developer is unwilling to supply any support due to the unnatural
> environment I assume.
> Daniel Lo Nigro wrote
> >
> > Since you mentioned unixodbc, I assume you're using the ODBC MySQL
> > connector. Is there any particular reason for this? Is it a limitation of
> > the software you're using (does it only support ODBC)?
> >
> > Have you tried the native .NET connector instead? It's a fully-managed
> > ADO.NET driver which doesn't require ODBC, and works with Mono. If you
> can
> > set the ADO.NET database provider the application uses, you should be
> able
> > to use it. See http://dev.mysql.com/downloads/connector/net/#downloads
> >
> > On Wed, Sep 12, 2012 at 10:34 AM, BadRobot <robster400@> wrote:
> >
> >> Ok, firstly, forgive me, as I'm far from experienced with these kind of
> >> things :)
> >>
> >> I've got a Procon gameserver controller
> >> (http://phogue.net/procon-frostbite/) running on mono 2.6.7 on Debian 6
> >> squeeze.
> >> Procon has a player stats & chat logger, via a plugin, which sends
> player
> >> data to a mysql (5.1.63) db. with unixodbc 2.2.14, & MySQL connector
> >> 5.1.11,
> >> I have also tried MySQL connector 5.1.9
> >> It should be noted however, that the issue persists with Unbuntu 12.04,
> >> Mono
> >> 2.10.8.1 & unixodbc 2.2.14
> >>
> >> I've moved the Procon setup from a Windows machine, where its been
> >> working
> >> great for months, & apart from the this logging problem, seems to be
> fine
> >> on
> >> top of mono.
> >>
> >> So, what is happening? Instead of filling the db with playernames & chat
> >> log
> >> entries, its filling it with invalid chars. All data to be logged is
> >> English
> >> with no unusual characters.
> >> Previous db entries while running on Windows display correctly on the
> >> stats
> >> website, new entries while running on Mono do not.
> >>
> >> When the procon plugin & sql db were all at default Latin1, it filled
> the
> >> db
> >> with just questionmarks, so I assumed a charset issue, changed all
> >> references of Latin1 to UTF8 in the Procon plugin source (its compiled
> on
> >> the fly at launch), and set MySQL to UTF8, and now it fills the db with
> >> Asian/Chinese characters....
> >>
> >> I've spent a long time with Google, and come to the conclusion somewhere
> >> the
> >> correct encoding or line endings are not being translated somehow either
> >> by
> >> Mono, or the unixodbc driver, but its a little above my head & I could
> be
> >> miles off the mark.
> >>
> >> Can anyone give me some suggestions on how to fix this?
> >> Thanks.
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://mono.1490590.n4.nabble.com/Mono-odbc-passing-invalid-chars-to-MySQL-DB-tp4656587.html
> >> Sent from the Mono - General mailing list archive at Nabble.com.
> >> _______________________________________________
> >> Mono-list maillist  -  Mono-list at .ximian
> >> http://lists.ximian.com/mailman/listinfo/mono-list
> >>
> >
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at .ximian
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
>
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Mono-odbc-passing-invalid-chars-to-MySQL-DB-tp4656587p4656598.html
> Sent from the Mono - General mailing list archive at Nabble.com.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20120913/76dc0990/attachment-0001.html>


More information about the Mono-list mailing list