Esempio n. 1
0
        private void loadPresetsButton_Click(object sender, EventArgs e)
        {
            string masterQuery = this.masterQueryTextBox.Text;

            FunRepository.ReadSettings(ref masterQuery, ref dataObjectCollecion);
            this.masterQueryTextBox.Text = masterQuery;

            this.dataObjectsListView.Items.Clear();
            string[] keys = dataObjectCollecion.Keys.ToArray();
            AddDataObjectsNamesToListView(keys);

            foreach (var key in dataObjectCollecion.Keys)
            {
                DataObject currentDataObject = dataObjectCollecion[key];
                if (currentDataObject.RunLoad && currentDataObject.ExcelFilePath != "")
                {
                    LoadForm.ShowLoadForm();
                    currentDataObject.DataTable = FunRepository.GetDataTable(FunRepository.GetConnectionString(currentDataObject.ExcelFilePath), currentDataObject.SqlQuery);
                    LoadForm.CloseForm();
                }
            }
        }
Esempio n. 2
0
        //private void excelFileRefreshSheetsButton_Click_1(object sender, EventArgs e) { RefreshExcelSheets(this.excelFilePathTextbox.Text); }
        private void queryLoadButton_Click(object sender, EventArgs e)
        {
            //pickup multithread for loading

            string excelFilePath = this.excelFilePathTextBox.Text;

            if (excelFilePath == "")
            {
                MessageBox.Show("File path is missing!"); return;
            }
            //System.Data.DataTable excelSheetDataTable;

            string queryString = queryTextBox.Text;

            if (queryString == "")
            {
                queryString = "SELECT * FROM [" + this.excelFileSheetsComboBox.Text.Replace("'", "") + "$]";                      /*+ "$B1:G3]"*/
            }
            this.queryTextBox.Text = queryString;

            LoadForm.ShowLoadForm();
            FillPreviewGridView(excelFilePath, ref queryString);
            LoadForm.CloseForm();
        }