private void button2_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt = (DataTable)this.dtList.DataSource; if (dt.Rows.Count > 0) { frmPrint print = new frmPrint(); print.DataForPrint = dt; print.PlayerName = txtName.Text; print.ListType = "Pigeon Result"; print.ShowDialog(); } }
private void button2_Click_1(object sender, EventArgs e) { try { DataTable dt = new DataTable(); dt = (DataTable)this.dtList.DataSource; frmPrint print = new frmPrint(); if (dt.Rows.Count > 0) { print.DataForPrint = dt; print.PlayerName = txtName.Text; print.ListType = "Banded Pigeon"; print.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }