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 8243399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:30:25+00:00 2026-06-07T21:30:25+00:00

I am using the following query: string query = @SELECT r.id, user_name, user_phone, date_create,

  • 0

I am using the following query:

string query = @"SELECT r.id, user_name, user_phone, date_create, REPLACE( date_payment,  '0000-00-00 00:00:00',  'Не оплачено' ) as 
                date_payment, payment_method, amount, rs.name_ru
                FROM request AS r, request_status AS rs
                WHERE r.status = rs.id";

And i am binding datatemplate in the following way:

DataTemplate>
    <TextBlock VerticalAlignment="Center" Text="{Binding date_payment}" Width="135" />
</DataTemplate>

Its throwing correct output except the “date_payment” Its output value comes “System.Byte[]“.
please help!!!

Thank from MBen

class ByteArrayToString : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                var listOfBytes = value as Byte[];
                string output = "";
                output = System.Text.Encoding.UTF8.GetString(listOfBytes);
                return output;
            }

            return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
  • 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-07T21:30:27+00:00Added an answer on June 7, 2026 at 9:30 pm

    date_payment is an Array, and you didn’t provide any way for WPF for displaying it, so it calls ToString . You can provide a data converter for it.

    Add a resource to your Window or page :

       <Window.Resources>
            <local:ByteArrayToString x:Key="ByteArrayConverter" />
        </Window.Resources>
    

    Use it in your TextBlock as such :

    <TextBlock VerticalAlignment="Center" Text="{Binding date_payement, Converter={StaticResource ByteArrayConverter}}" Width="135" />
    

    Now you need to add a new class that does the conversion :

        class ByteArrayToString : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            {
                if (value != null)
                {
                    var listOfBytes = value as Byte[];
                    string output ="";
                    output = listOfBytes.Aggregate(output, (current, elemt) => current + elemt.ToString());
                    return output;
                }
    
                return "";
            }
    
            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            {
                return DependencyProperty.UnsetValue;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SqlDependency set up using the following query: string sql = "SELECT
I'm using the following query to select users from my 'users' table with the
I am using the following query to select wait times from the table wait_times
i've been using the following query: select LEN(columnname) as columnmame from dbo.amu_datastaging This works,
I am using following query: $search = mysql_query(SELECT * FROM `users` WHERE username LIKE
I'm using the following query to perform a search in SQLite. public MatrixCursor listViewCursor(String
I am using following query which works fine for me except one problem SELECT
I'm using the following query to extract the frequent short values from a mediumblob
I am using following SQL Query: SELECT `comment`.`id` AS `comment_id` , count( `comment_likes`.`comment_id` )
For example, check this following query; $query = SELECT * FROM users WHERE user='{$_POST['username']}';

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.