Esempio n. 1
0
        public IEnumerator <IGridDataRecord> GetEnumerator()
        {
            var ds = DirectConnectUtils.GetDataSet(_settings.TableOrViewName, _settings.IsStoredProcedure);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                yield return(new DirectConnectGridDataRecord(dr, ds.Tables[0].Columns.Count));
            }
            ds.Clear();
        }
 private void previewButton_Click(object sender, EventArgs e)
 {
     try
     {
         var ds = DirectConnectUtils.GetDataSet(tableViewOrSPNameTextBox.Text, isStoredProcedureCheckbox.Checked);
         dataGridView1.DataSource = ds.Tables[0];
     }
     catch (Exception ex)
     {
         string errString = String.Format("Error Connecting To {0}...{1}", tableViewOrSPNameTextBox.Text, ex.Message);
         Alert(errString);
     }
 }