Beispiel #1
0
        private void GetDataFromSQL()
        {
            string message = "";

            table = DBPlacebo.GetAllCustomersFromSQLServer(connectionString, tableName, "", out message);
            view  = table.DefaultView;
            dgCustomers.ItemsSource = table.DefaultView;
            lbMessages.Content      = message;
        }
Beispiel #2
0
 private void IniMyStuff()
 {
     try
     {
         string msg = "";
         connStr            = Properties.Settings.Default.Tietokanta;
         lbMessages.Content = connStr;
         tableName          = Properties.Settings.Default.Taulu;
         dt = DBPlacebo.GetAllCustomersFromSQLServer(connStr, tableName, "", out msg);
         FillMyCombo();
         lbMessages.Content = msg;
     }
     catch (Exception ex)
     {
         lbMessages.Content = ex.Message;
     }
 }
        private void SuodataVE1()
        {
            string message = "";
            string city    = "";

            try {
                if (cbCountries.SelectedIndex >= 0)
                {
                    city = cbCountries.SelectedValue.ToString();
                    dgCustomers.ItemsSource = DBPlacebo.GetAllCustomersFromSQLServer(ConnStr, TableName, city, out message).DefaultView;
                }
            } catch (Exception ex) {
                message = ex.Message;
            } finally {
                lbMessages.Content = message;
            }
        }
        private void IniMyStuff()
        {
            //TODO täytetään combobox asiakkaitten maitten nimillä
            //esimerkki kuinka App.Configissa oleva connectionstring luetaan
            string message = "";

            try {
                ConnStr            = JAMK.ICT.Properties.Settings.Default.Tietokanta;
                lbMessages.Content = ConnStr;
                TableName          = JAMK.ICT.Properties.Settings.Default.Taulu;
                dt = DBPlacebo.GetAllCustomersFromSQLServer(ConnStr, TableName, "", out message);
                dv = dt.DefaultView;
                FillMyCombo();
            } catch (Exception ex) {
                lbMessages.Content = ex.Message;
            }
        }
Beispiel #5
0
        private void InitMyStuff()
        {
            try
            {
                string message = "";

                //esimerkki kuinka App.Configissa oleva connectionstring luetaan
                connStr            = Properties.Settings.Default.Tietokanta;
                lbMessages.Content = connStr;
                tableName          = Properties.Settings.Default.Taulu;
                dtCustomerData     = DBPlacebo.GetAllCustomersFromSQLServer(connStr, tableName, "", out message);
                // Luodaan DataTablen oletusnäkymästä DataView
                view = dtCustomerData.DefaultView;
                FillMyCombo();
                lbMessages.Content = message;
            }
            catch (Exception ex)
            {
                lbMessages.Content = ex.Message;
            }
        }
Beispiel #6
0
        private void SuodataVE1()
        {
            //Haetaan asiakastiedot palvelimelta
            string messu    = "";
            string kaupunki = "";

            try
            {
                if (cbCountries.SelectedIndex >= 0)
                {
                    kaupunki = cbCountries.SelectedValue.ToString();
                    dgCustomers.ItemsSource = DBPlacebo.GetAllCustomersFromSQLServer(ConnStr, TableName, kaupunki, out messu).DefaultView;
                }
            }
            catch (Exception ex)
            {
                messu = ex.Message;
            }
            finally
            {
                lbMessages.Content = messu;
            }
        }