How to go from one row to another row in datarow?
I am new in C#..struggling to learn it..Can anyone help me in this..i want to know how can i go from one row to other row based on previous row value..
Example:1st row-> MerchantNo:001102534
2nd row->OutletName
3rd row->Emptyrow
4th row ->MerchantNo TerminalNum CardType ....
5th row ->1102534 7700100456 Amex
I am having a datatable filled with this kind of data..I have written a code for removing the characters from 1st row and to give only the number.Now based on this number i want to go to all those rows which contains this number and want to retrieve the data from that row and insert it into sql table..
how can i do this...hope u understood my doubt..This is the code which i have written..
string Mno = "";
foreach (DataRow rowExcel in dtExcel.Rows)
{
foreach (DataColumn colExcel in dtExcel.Columns)
{
Mno = rowExcel[colExcel].ToString().Trim();
if (Mno != "")
{
string Mno1 = Mno.Substring(16, 10);
Mno =Mno1.ToString();
//Int32 MerchNo = Convert.ToInt32(Mno);
}
break;
}
if(Mno!="")
break;
}
How can i proceed further..