Datapicker Mysql

Asked

Viewed 49 times

0

How to take the value that is in datepicker and do a search in the database? I tried this way but it is not correct

var cmd = new MySqlCommand("SELECT distinct id, Pedagio, Carro, Placa, Fabricante, Ano, Cor, Data FROM tcc WHERE Data = '" + txtDate.Date + "'", _connection);

I was without the name I put now, but still without performing the action.

<DatePicker x:Name="txtDate" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="0,208,0,0" VerticalAlignment="Top" Width="415">

2 answers

2

var cmd = new Mysqlcommand("SELECT distinct id, Car, Plate, Manufacturer, Year, Color, Date FROM New WHERE Data = '"+ Datepicker+"'", _Connection);

instead of WHERE is WHARE, make sure that’s not it

  • This is another problem, but what he asked about is how to get the date of the datepicker control.

  • I’ve identified that mistake, but that’s not why.

1


Search the value of the property Date in this control.

var cmd = new MySqlCommand("SELECT distinct id, Carro, Placa, Fabricante, Ano, Cor, Data   
FROM Novo WHERE Data = '"+ DatePicker.Date +"'", _connection);
  • I tried and this property does not work in UWP app.

  • What does he show you? If it were shaman it would be .value, but, yes, it is .date on UWP.

  • it gives me the option of Datepicker.DateProperty. Error if put only date.

  • @Jon Post the XAML of your Datepicker control.

  • the shaman is in the post

Browser other questions tagged

You are not signed in. Login or sign up in order to post.