have created 2 data table
1) ImportExcelDT
2) ExportExcelDT
then i am checking if there is row
and validating every columns of it
int Col = 0;
using (OleDbDataAdapter oda = new OleDbDataAdapter("SELECT * FROM [" + sheet1 + "]", excel_con))
{
oda.Fill(ImportExcelDT);
if (ImportExcelDT.Rows.Count > 0)
{
for (int i = 0; i < ImportExcelDT.Rows.Count; i++)
{
string EmpCod = ImportExcelDT.Rows[i]["Employee Code"].ToString();
bool isEmpCod = Regex.IsMatch(EmpCod, @"^[a-zA-Z0-9/-]+$");
//Here i am checking condition if its false
if (!isEmpCod)
{
count++;
//Now i want to copy and delete selected row in another data table
for (int j = 0; j < ImportExcelDT.Rows.Count; j++)
{
ImportExcelDT.Rows[j][i] = ExportExcelDT.Rows[j][Col];
ImportExcelDT.Rows[i].Delete();
}
}
else
{
}
am bit confused on which columns should i select on ImportExcelDT.Rows[j][i] and ExportExcelDT.Rows[j][Col];
while copying
Any suggestion are welcome