Form1.unprocessed_dataset = Form1.orginal_unprocessed_dataset.Copy();
private void button1_Click(object sender, EventArgs e)
{
Form1.unprocessed_dataset = Form1.orginal_unprocessed_dataset.Copy();
if (textBox1.Text.All(char.IsDigit) && textBox1.Text != "0" &&
!string.IsNullOrEmpty(textBox1.Text.Trim()) &&
!string.IsNullOrWhiteSpace(textBox1.Text.Trim()))
{
DataTable dt = Form1.unprocessed_dataset.Tables[comb_selected_sheet];
for (int x = 0; x < dt.Rows.Count;x++ )
{
if (!string.IsNullOrEmpty(Form1.unprocessed_dataset.T ables[comb_selected_sheet].Rows[x][3].ToString()) &&
Form1.unprocessed_dataset.Tables[comb_selected_sheet].Rows[x][3].ToString().Length >= Convert.ToInt32(textBox1.Text))
{
Form1.unprocessed_dataset.Tables[comb_selected_sheet].Rows[x][3] =
Form1.unprocessed_dataset.Tables[comb_selected_sheet].Rows[x][3].ToString()
.Substring(0, Convert.ToInt32(textBox1.Text));
//Form1.processed_dataset.Tables[comb_selected_sheet].Rows[x][3] =
// Form1.processed_dataset.Tables[comb_selected_sheet].Rows[x][3].ToString()
// .Substring(0, Convert.ToInt32(textBox1.Text));
}
}
RemoveDuplicateRows(Form1.unprocessed_dataset.Tabl es[comb_selected_sheet],"Code", "Area Code");
// RemoveDuplicateRows(Form1.processed_dataset.Tables[comb_selected_sheet], "Code", "Area Code");
Form1.unprocessed_dataset.Tables[comb_selected_sheet].AcceptChanges();
form.select_regular_datatable(comb_selected_sheet) ;
}
else
{
MessageBox.Show("مقدار وارد شده معتبر نیست.");
}
}
برچسب:
نویسنده: خنج