[Mono-list] asp.net conversion advice needed.
Diego Frata
diego.frata at gmail.com
Thu Jul 30 20:01:31 EDT 2009
First of all, it's preferred that you choose using MySql Connector/NET
instead of an MySql Connector/ODBC. It's simplier than using ODBC and it's
far wide used.
For using MySQL Connector/NET, put your connection string like this:
<connectionStrings>
<add name="MySql" providerName="MySql.Data.MySqlClient"
connectionString="server=127.0.0.1;user=root;pwd=root;database=MyDatabase;"/>
</connectionStrings>
And make sure that MySql.Data.dll is registered on GAC, or it's inside the
bin directory of your ASP.NET website.
If you can't avoid using ODBC:
1) Reinstall (or install, if you haven't) the MySQL Connector/ODBC from this
page http://dev.mysql.com/downloads/connector/odbc/5.1.html.
2) Configure your unixODBC again and check for incorrect informations. If
you need this URL has a good guidance http://www.unixodbc.org/odbcinst.html
3) Test your provider following the instructions on
http://www.mono-project.com/ODBC
This way you will be using the libodbc.so and not MySQL Connector/NET
(MySql.Data) to access the database.
It should work as expected. If this doesn't work, then I will need to see
your files.
But seriously, you should use the first option, it's far better and easier
to configure.
Diego Frata
diego.frata at gmail.com
On Thu, Jul 30, 2009 at 5:49 PM, manshack_one <manshack_one at yahoo.com>wrote:
>
> Each Access form is converted into a separate asp page. In each page there
> are options to either declare
> a connection string there or use the one from web.config. We went into
> each
> page and made sure it's trying to use 'ConnectionString' from the
> web.config
> file. This works in windows with a connection string that contains
> 'Driver="MySql ODBC 5.1 Driver" but when you move that web.config file to
> the linux box the connector/net driver that was installed there isn't
> called
> the same thing. On Suse all we knew to do was install the connector/net
> driver according to the mono page where it talks about adding it to the
> GAC.
> Since it can't find a driver called 'MySQl ODBC 5.1 Driver" it seems to be
> defaulting to standard odbc drivers which are not set up at all. Honestly
> I
> don't even know how to setup the dsn on suse using mysql. It won't be a
> problem to debug this on the server. Right now it's just a test box
> anyways.
>
> I'm not at work so I can't get a copy of the web.config right now.
> Hopefully tomorrow I'll be back in the office.
>
>
>
>
> Diego Frata wrote:
> >
> > Could you show how did you configure the DSN on Windows and on Suse? And
> > how
> > are you trying to open the connection?
> >
> > It's always good to debug the application on the server if it's not a
> > heavily used production one.
> >
> > Diego Frata
> > diego.frata at gmail.com
> >
> >
> > On Thu, Jul 30, 2009 at 3:16 PM, manshack_one
> > <manshack_one at yahoo.com>wrote:
> >
> >>
> >> We're working on a project to convert MS Access applications to ASP.net
> >> using
> >> a product called Microtools. It's clunky and we end up doing a lot of
> >> debugging but we've been able to get Northwind to run locally after
> >> conversion to ASP.net. Problem comes in when we copy the website to the
> >> server (Suse) which has Mono and the latest Mysql connector on it.
> After
> >> copying it over there are errors pertaining to the odbc connection when
> >> you
> >> pull up the screens on Mono. What's apparent to me is that the DSN in
> >> windows and the web.config file are set to a windows version of the
> mysql
> >> driver (5.1). When you move it over all of a sudden linux is unable to
> >> match that DSN name so it defaults to the system odbc driver libodbc.so.
> >> We
> >> went through the process of installing unixODBC but it's now saying
> there
> >> is
> >> no default data source set up. Which means to me that it's still not
> >> using
> >> the mysql connector.
> >>
> >> Would we be doing any better to put monodevelop on the linux box and
> >> debug
> >> the c# asp code that we get from microtools there? Would monodevelop do
> >> a
> >> better job of getting the db connection to mysql? What we're up against
> >> right now is that the changes we're making in visual studio to the
> >> web.config to make it work on the windows desktop don't have an
> >> equivalent
> >> in linux and for the life of me I can't make the web.config use the
> mysql
> >> connector.
> >>
> >> Would monodevelop have a better chance of reading the mysql connection
> if
> >> we
> >> developed on the linux box instead of the windows box? We still have to
> >> run
> >> microtools and access in windows but maybe we could just push the
> >> converted
> >> code out to the server and debug it there so that when it's running
> >> correctly in testing we'll know there is not an extra step to make it
> >> talk
> >> to mysql on the linux box.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/asp.net-conversion-advice-needed.-tp24743915p24743915.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
> >>
> >
> > _______________________________________________
> > Mono-list maillist - Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/asp.net-conversion-advice-needed.-tp24743915p24747068.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/20090730/de287b8d/attachment.html
More information about the Mono-list
mailing list