Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Id Location DateFrom DateTo RateType Rate
- 1 LA 01/01/2017 01/01/2018 AverageRate 18
- public partial class MainWindow :
- {
- public MainWindow()
- {
- InitializeComponent();
- string connectionString = "datasource= ;port=3306;username= ;password= ";
- MySqlConnection connection = new MySqlConnection(connectionString);
- MySqlCommand sAR = new MySqlCommand("Select Amount from Daily.Rates where RateType = 'Average Hourly Wages'", connection);
- MySqlCommand sARF = new MySqlCommand("Select DateFrom from Daily.Rates where RateType = 'Average Hourly Wages'", connection);
- MySqlCommand sART = new MySqlCommand("Select DateTo from Daily.Rates where RateType = 'AverageRate'", connection);
- try
- {
- connection.Open();
- txtAR.Text = sAHW.ExecuteScalar().ToString();
- dfAR.Text = sAHWF.ExecuteScalar().ToString();
- dtAR.Text = sAHWT.ExecuteScalar().ToString();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- connection.Close();
- }
- Id Location DateFrom DateTo RateType Rate
- 1 LA 01/01/2017 10/11/2017(DateFrom-1) AverageRate 18
- 2 LA 10/12/2017 01/01/2018 AverageRate 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement