Ghamai Khuram

Ghamai Khuram

  • 1.7k
  • 19
  • 2.3k

DataGridview unbound data imported from excel

Jul 8 2018 11:24 PM
Hello,
 
I am importing data from excel to Datagridview1 and Datagridview2 which has columns of Group number, Member name
 
I want to copy the Group number from dataGridview2 to Datagridview1 if Member name is matching non case sensitive ignore characters like .,- and ect. something like .contains will be great
 
below are the codes that i already tried and after error/failed i converted them to comment
 
foreach (DataGridViewRow kk in datagridcorrect.Rows)
{
foreach (DataGridViewRow cell in Memnum.Rows)
{
//string corct;
//string memn;
//corct = kk.Cells[0].Value.ToString();
// memn = cell.Cells[0].Value.ToString();
// corct = Convert.ToString(kk.Cells[0].Value);
// memn = Convert.ToString(cell.Cells[0].Value);
//bool b;
// b = kk.Cells[0].Value.ToString().Contains(cell.Cells.ToString());
// if(mem.Equals(correct))
//if (object.Equals(kk.Cells[1].Value, cell.Cells[1].Value))
// if(b == true)
{
kk.Cells[0].Value = cell.Cells[0].Value;
}
}
}
 
I really worked alot on this any help will be highly appreciated!
thanks

Answers (1)