Problem accessing Linux DB using Stored Procedures / Windows Works Fine!?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
kidkool345
Posts: 3
Joined: Sun 02 Jul 2006 17:47

Problem accessing Linux DB using Stored Procedures / Windows Works Fine!?

Post by kidkool345 » Sun 02 Jul 2006 21:56

Hi:

I'm developing a C#.NET web application that will use MySQLDirect.net to access a MySQL database on a Linux system using stored procedures.

I have the identical MySQL database running on Windows without any problems - I can use both mycommand.ExecuteNonQuery and mycommand.ExecuteReader on the Windows System using MySQLDirect.NET

On the Linux box the ExecuteNonQuery works just fine, however I am unable to get any data from the ExecuteReader. (In the debugger I have verified that the connection strings are working!)

This could be caused by me using the wrong commands - or there may be a setting required on the Linux MySQL box before the ExecuteReader will work. (Help!)

I have attached the code that I am using - the ExecuteReader works fine on Windows and it returns data, on Linux it is trapped by the "catch".

If anyone has any suggestions they would be greatly appreciated!

Thanks,

Fred
-----------------------

Code: Select all

public MySqlDataReader memoryctlgetallnew()
        {
            MySqlConnection myConnection = new MySqlConnection();
            myConnection.ConnectionString = "server=90.0.0.26;uid=webserv;pwd=webpass;database=mycsport_dbo;";

            MySqlCommand myCommand = new MySqlCommand("memoryctlgetall", myConnection);

            myCommand.CommandType = CommandType.StoredProcedure;

            try
            {
                myConnection.Open();
                return  myCommand.ExecuteReader(CommandBehavior.CloseConnection);
            }
            catch
            {
                return null;
            };

        }

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 03 Jul 2006 06:59

What is the full version of your MySql database on Linux.
And what is the text of the exception you get? When do you get it?

kidkool345
Posts: 3
Joined: Sun 02 Jul 2006 17:47

Problem Solved

Post by kidkool345 » Mon 03 Jul 2006 17:06

Alexey:

While answering your questions I "tripped" upon the results. Some of my stored procedures had the table names in upper case and some were in lower case. (The tables themselves are all in lower case)

So: The stored procedures all worked fine on Windows since it doesn't care about case. When I called stored procedures that referenced the tables in uppercase I had problems!

Thanks for your help!

Fred

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 04 Jul 2006 06:39

I see. It was next to impossible for us to figure this out.

kidkool345
Posts: 3
Joined: Sun 02 Jul 2006 17:47

Post by kidkool345 » Tue 04 Jul 2006 13:39

Alexey:

This was a tricky one for me too especially since some SP's worked and some did not!

Yesterday I was going to post both the class lib and source code and I'm sure that you would have found it immediately!

For now I'm all set - since the system will use a Linux host I will always connect to a Linux MySQL server during development so some of these case sensitive typos don't sneek into the code!

Thanks for your help - it put me on the right direction to solving the problem!

Fred

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 12 Jul 2006 07:22

You are welcome.

Post Reply