private void btnContinue_Click(object sender, RoutedEventArgs e) { string direction = ""; if (ExcelTable != null && ExcelTable.Columns.Count == 8) { direction = "VERTICAL"; } else { direction = "HORIZONTAL"; } try { DataSet ds = cr.ImportPrice(ExcelTable, usercode, direction); MessageBox.Show(ds.Tables[0].Rows[0]["result"].ToString().Replace("<br>", "\n")); } catch (Exception ex) { MessageBox.Show(ex.Message); } btnContinue.IsEnabled = false; }