Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. MySqlCommand serialBox_1 = new MySqlCommand("Select serial_Units from Units where " + stationSelection_1 = "station_Units", connection);
  2.  
  3. public MainWindow()
  4. {
  5. InitializeComponent();
  6.  
  7.  
  8. string connectionString = "SERVER=localhost;DATABASE=dbname; UID=myPC;Password=mypw;";
  9.  
  10. MySqlConnection connection = new MySqlConnection(connectionString);
  11.  
  12. MySqlCommand stationList = new MySqlCommand("Select stationNumber_stations from stations", connection);
  13. connection.Open();
  14.  
  15.  
  16. DataTable dt_stations = new DataTable();
  17. dt_stations.Load(stationList.ExecuteReader());
  18. connection.Close();
  19.  
  20. stationComboBox_1.DataContext = dt_stations;
  21. stationComboBox_1.ItemsSource = dt_stations.DefaultView;
  22.  
  23. string stationSelection_1 = stationComboBox_1.Text;
  24.  
  25.  
  26. MySqlCommand serialBox_1 = new MySqlCommand("Select serial_Units from Units where " + stationSelection_1 = "station_Units", connection);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement