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

  • SEARCH
  • Home
  • 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 8958983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:20:34+00:00 2026-06-15T15:20:34+00:00

I am writing a C# WPF application with controls bound to a MySQL 5.5

  • 0

I am writing a C# WPF application with controls bound to a MySQL 5.5 database. I’m populating a DataTable using a MySqlDataAdapter, passing in a MySQL SELECT query.

When the query is something trivial, like SELECT * FROM People or SELECT LastName, FirstName, PersonID FROM People, all is well and my ListBox control ends up populated with the expected names.

When the query contains a fairly simple CONCAT operator, though, the query silently fails and the ListBox stays empty. In particular neither of the following have worked, even though both work fine from within the MySQL command line.

SELECT CONCAT(LastName, FirstName) as Name FROM People
SELECT CAST(CONCAT(LastName, FirstName) AS CHAR) as Name FROM People

Both LastName and FirstName are defined as VARCHAR. So, I wouldn’t expect this to be an instance of CONCAT returning a binary string in any case. I mention that because it appears to have been the problem for similar issues that other folks have mentioned.

  • 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-06-15T15:20:36+00:00Added an answer on June 15, 2026 at 3:20 pm

    I’d imagine the DataAdapter attempts to parse your query into an internal format so that it can do things like generate Update and Insert commands.

    Can you fill your datatable using a MySqlDataReader instead? This is probably only helpful if you are not planning to do database updates with the DataTable

    Going from memory…

    MySqlCommand cmd = new MySqlCommand(query, connection);
    MySqlDataReader reader = cmd.ExecuteReader();
    DataTable dt = new DataTable();
    dt.Load(reader);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application using WPF, and I need to make something that looks
I'm writing an application using WPF, and I need to make something that looks
I am writing a WPF application using Self-Tracking Entities. I'm having trouble Disabling/Enabling my
I'm writing tests using WiPFlash for a WPF application that has been developed in
When writing a WPF application using MVVM, I want to use a WCF service,
I am writing a WPF application and I have a slider bound to a
We are writing a WPF application using Entity framework (Silverlight with RIA services to
I am writing WPF application using MVVM. I have ObservableCollection of my items: public
I'm writing a WPF application using a MVVM pattern and using Prism in selected
I am writing a WPF application using C#. I need the application to continue

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.