The calling code:
private void buttonRunSQL_Click(object sender, EventArgs e)
{
WaitDialog wd = new WaitDialog();
wd.Show();
System.Windows.Forms.Application.DoEvents();
try
{
_exportsqlstatement = this.textBoxCandidateSQL.Text.Trim();
DataSet ds = DataHelper.ReturnDataSet(_exportsqlstatement);
this.dataGridViewDataToExport.SuspendLayout();
this.dataGridViewDataToExport.Columns.Clear();
this.dataGridViewDataToExport.DataSource = ds.Tables[0];
this.dataGridViewDataToExport.ResumeLayout();
labelCountOfItemsToExport.Text = "Row Count: " + ds.Tables[0].Rows.Count.ToString();
MessageBox.Show("Data has been selected based on your preferences and is ready for export");
}
catch (Exception eee)
{
DisplayErrorMessage(eee, "SQL error.");
}
wd.Hide();
}
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42:





by: knowltonPosted on 2009-10-21 at 09:53:17ID: 25625839
Some sample code.
Select allOpen in new window