private void btnBrowerForUSDDataset_Click(object sender, EventArgs e) { openDlg.ShowDialog(this); if (openDlg.FileName == "") { return; } lblUSDPath.Text = openDlg.FileName; DataSet ds = new DataSet(); ds.ReadXml(lblUSDPath.Text); DataTableSelectorWnd dtsw = new DataTableSelectorWnd("Primary Site DataTable", ds); dtsw.ShowDialog(this); if (dtsw.TableName == "") { ds.Dispose(); } else { if (_usd != null) { _usd.Dispose(); } _usd = ds.Tables[dtsw.TableName].Copy(); ds.Dispose(); } dtsw.Dispose(); dtsw = null; }
public DataTableWnd(DataSet dataset) { InitializeComponent(); DataTableSelectorWnd dtsw = new DataTableSelectorWnd("", dataset); dtsw.ShowDialog(this); if (dtsw.TableName == "") { return; } this.table = dataset.Tables[dtsw.TableName]; this.Text = "Data Table [" + table.TableName + "]"; this.toolStripStatusLabel1.Text = "Total Records: " + table.Rows.Count; this.grid.DataSource = table.DefaultView; dtsw.Dispose(); }