I can not get my return from my select in the bank. Where do I show the data in a listview.
using (_connection = new MySql.Data.MySqlClient.MySqlConnection("Database=roubo_furto; Data Source=192.168.0.17;User Id=RFID;Password=1234;SslMode=None;"))
{
System.Text.EncodingProvider ppp;
ppp = System.Text.CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider(ppp);
_connection.Open();
var cmd = new MySqlCommand("SELECT distinct id, Carro, Placa, " +
"Fabricante, Ano, Cor, Data FROM tcc " +
"WHERE DATE_FORMAT(Data,'%d/%m/%Y') = STR_TO_DATE(" + txtDate.Date.ToString("dd/MM/yyyy") +
", '%d/%m/%Y')", _connection);
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
listView.Items.Add("Ocorrencia: Nº " + reader.GetString(0) + " " + "\nData: " + Convert.ToDateTime(reader.GetString(7)).ToString("dd/MM/yyyy") + " " + "\nCarro: " + reader.GetString(2) + " " + "\nPlaca: " + reader.GetString(3) + " " + "\nCor: " + reader.GetString(6) + " " + "\nAno: " + reader.GetString(5) + " " + "\nFabricante: " + reader.GetString(4) + "\n\n");
}
}
<DatePickerx:Name="txtDate" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="0,208,0,0" VerticalAlignment="Top" Width="415" ToolTipService.ToolTip="" MonthFormat="{}{month.solo.full}">