我正在使用以下查询:
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";
我正在通过以下方式绑定数据模板:
DataTemplate>
<TextBlock VerticalAlignment="Center" Text="{Binding date_payment}" Width="135" />
</DataTemplate>
除了“ date_payment ”之外,它的抛出正确输出它的输出值来自“ System.Byte [] ”。请帮忙!!!
来自 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;
}
}