how do retrieve 8 th coloums and 10 th row in datareader?

Recommended Answers

All 3 Replies

Well..

What have you tried? what have you read?

You can do this using a while loop by counting the row index in a counter variable as you advance along each row

rowCnt = -1;//Row Counter
string name= null;
while(myDataReader.Read())//Advance to the next row
        {
            rowCnt++;
            if(rowCnt == 10)// Check row index
            {
                name = myDataReader[8].ToString();
                break;// read the desired value in exit from loop
            }
        }

thanks for ur help Aneesh_Argent ..thank u so much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.