How to insert date to sql database from c++/CLI winform?

  c++-cli, sql, windows

I made month calendar. How to make "date" variable from date from calendar and how to instert this date to mysql database?

MySqlCommand^ zapytanie = gcnew MySqlCommand("INSTERT INTO lotnisko.loty (data) VALUES ('" +data +"') ", laczbaze);

when I did that, it didn’t work:

private: System::Void kalendarz_DateChanged(System::Object^ sender, System::Windows::Forms::DateRangeEventArgs^ e) {
data = kalendarz->SelectionStart;
}

I created "data" in sql with DATE format.

Source: Windows Questions

LEAVE A COMMENT