Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6323435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:30:57+00:00 2026-05-24T16:30:57+00:00

I’m using the MySql.Data dll from MySql and trying to execute a query to

  • 0

I’m using the MySql.Data dll from MySql and trying to execute a query to transfer data from a MySQL table to an MSSQL table. I am running the following code:

MySqlCommand catCmd = new MySqlCommand();

catCmd.CommandType = System.Data.CommandType.Text;
catCmd.Connection = connection;

//Add categories to static class
catCmd.CommandText = "SELECT c.categories_id, categories_image, parent_id, categories_status, categories_name, categories_description FROM categories c JOIN categories_description d ON c.categories_id = d.categories_id ORDER BY categories_status";
MySqlDataReader catReader = catCmd.ExecuteReader();
while (catReader.Read())
{
    try
    {
        tables.categories.Add(new category(0, catReader.GetInt32(0), catReader.GetString(1), catReader.GetInt32(2), catReader.GetInt32(3), catReader.GetString(4), catReader.GetString(5)));
    }
    catch
    {
        tables.categories.Add(new category(0, catReader.GetInt32(0), "", catReader.GetInt32(2), catReader.GetInt32(3), catReader.GetString(4), catReader.GetString(5)));
    }
}
reader.Close();

When I run this query directly in MySQL query browser on the same DB it returns 115 records. But within the program, with the code above. It returns 106 rows. Theres nothing diffrent and i’m very frustrated. Any clues?

UPDATE

This is how i’m testing for the number of returned records:

Visual Studio - Debug Results View

Here is the same query in Mysql Query Browser

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:30:58+00:00Added an answer on May 24, 2026 at 4:30 pm

    Please Try Some thing Link this.

      public DataTable DataReader(string query)
        {
            DataTable mysqlDataTable = new DataTable();
            try
            {
                ConnectToMysql();// Add Mysql Connection Here. 
                MySqlDataAdapter readerAdapter = new MySqlDataAdapter(query, MysqlDBConnection);//MySqlConnection MysqlDBConnection;
                readerAdapter.Fill(mysqlDataTable);
                readerAdapter.Dispose();
                MysqlDBConnection.Close();
                MysqlDBConnection.Dispose();
                return mysqlDataTable;
            }
            catch
            {
                throw;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.