Problem with MySqlDataReader() - is it a limitation of the trial-Version?

Problem with MySqlDataReader() - is it a limitation of the trial-Version?

Postby jlo » Thu 10 Feb 2005 12:42

Hey Guys,

I´m using MySQLDirect .NET 2.70 TRIAL-Version and there a problems with the MySqlDataReader().

Code: Select all

MySqlCommand myCmd = new MySqlCommand();
         try
         {
            myCmd.Connection = DBBau._MySQLConnect;
            MySqlDataReader myReader;
            myCmd.Connection.Open();               
            myCmd.CommandText = mySelect;

            myReader = myCmd.ExecuteReader();
            if ( myReader.HasRows )
            {
               while ( myReader.Read() )
               {
                  /// Tabellen- und Bedingungen lesen
                  myTable1 = myReader.GetValue(2).ToString();
                  myTable2 = myReader.GetValue(3).ToString();
                  myTable3 = myReader.GetValue(4).ToString();
                  myBedin1 = myReader.GetValue(5).ToString();
                  myBedin2 = myReader.GetValue(6).ToString();
                  myBedin3 = myReader.GetValue(7).ToString();
                  myOrder1 = myReader.GetValue(12).ToString();
                  myOrder2 = myReader.GetValue(13).ToString();
                  myOrder3 = myReader.GetValue(14).ToString();
                  SortOrder = myReader.GetValue(15).ToString();

                  /// Feld-Array mit Informationen füllen
                  FieldArray[arrayCounter] = myReader.GetValue(8).ToString();
                  arrayCounter++;               
               }
               myReaderOK = true;
            }
            myReader.Close();            
         }         
         finally
         {
            myCmd.Connection.Close();
         }


All "myReader.GetValue.ToString()"-Statements provides empty strings. I know, that there is a limit of 6 Columns in TRIAL-Version. But in this case, the Reader delivers nothing.

Is it a limitation of the TRIAL-Version???

If so, i could stop testing the TRIAL, cause it took a lot of time to convert my code.

If not, where is the problem in my Code, which works fine with ByteFX and .NET-Connector?

thx for answering
jlo - germany
jlo
 
Posts: 7
Joined: Wed 09 Feb 2005 08:18

Re: Problem with MySqlDataReader() - is it a limitation of the trial-Version?

Postby Oleg » Thu 10 Feb 2005 16:08

Yes, it is a trial restriction, myReader.GetValue(6) - returns null value.
Oleg
Devart Team
 
Posts: 264
Joined: Thu 28 Oct 2004 13:56

Postby jlo » Thu 10 Feb 2005 16:58

Hi Oleg,

thx for your answer, but my question is not exactly answered or I didn´t understand it.

If the TRIAL-Version DataReader return correct values from col(0) to col(5), why are my variables

Code: Select all
myTable1 = myReader.GetValue(2).ToString();
myTable2 = myReader.GetValue(3).ToString();
myTable3 = myReader.GetValue(4).ToString();
myBedin1 = myReader.GetValue(5).ToString();


= null?

Don´t forget, that my variables in this code-snippet are all "null"...

Regards
jlo
jlo
 
Posts: 7
Joined: Wed 09 Feb 2005 08:18

Postby Serious » Tue 15 Feb 2005 08:15

Check regularity of your SQL query and presence of the data in the table.
Also you need to check result of command execution:
Code: Select all
if ( myReader.HasRows )
{
//...
}
else
{
  MessageBox.Show("Empty reader.");
}
If it does not help, send us your query (mySelect variable) and definition of your own database objects.
Serious
 

Postby jlo » Wed 16 Feb 2005 17:25

Hi Oleg,

my SQL-Syntax couldn´t be wrong, because it works great so far with other DataProviders.

Yesterday I have ordered the registered Version of MySQLDirect Professional. I´ll check the problem in a view days again...

So long...

jlo
jlo
 
Posts: 7
Joined: Wed 09 Feb 2005 08:18

Postby jlo » Mon 21 Feb 2005 10:52

Hi Oleg,

now i´ve installed the registered version. The problems are solved.

thx for support
jlo - germany
jlo
 
Posts: 7
Joined: Wed 09 Feb 2005 08:18


Return to dotConnect for MySQL