Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Id Location DateFrom DateTo RateType Rate
  2. 1 LA 01/01/2017 01/01/2018 AverageRate 18
  3.  
  4. public partial class MainWindow :
  5. {
  6. public MainWindow()
  7. {
  8. InitializeComponent();
  9. string connectionString = "datasource= ;port=3306;username= ;password= ";
  10. MySqlConnection connection = new MySqlConnection(connectionString);
  11. MySqlCommand sAR = new MySqlCommand("Select Amount from Daily.Rates where RateType = 'Average Hourly Wages'", connection);
  12. MySqlCommand sARF = new MySqlCommand("Select DateFrom from Daily.Rates where RateType = 'Average Hourly Wages'", connection);
  13. MySqlCommand sART = new MySqlCommand("Select DateTo from Daily.Rates where RateType = 'AverageRate'", connection);
  14.  
  15. try
  16. {
  17. connection.Open();
  18. txtAR.Text = sAHW.ExecuteScalar().ToString();
  19. dfAR.Text = sAHWF.ExecuteScalar().ToString();
  20. dtAR.Text = sAHWT.ExecuteScalar().ToString();
  21. }
  22.  
  23. catch (Exception ex)
  24. {
  25. MessageBox.Show(ex.Message);
  26. }
  27. connection.Close();
  28. }
  29.  
  30. Id Location DateFrom DateTo RateType Rate
  31. 1 LA 01/01/2017 10/11/2017(DateFrom-1) AverageRate 18
  32. 2 LA 10/12/2017 01/01/2018 AverageRate 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement