how to convert dataset to list

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 793 Views - Last Post: 27 November 2013 - 07:25 AM Rate Topic: -----

#16 vivek20055  Icon User is offline

  • D.I.C Head

Reputation: -7
  • View blog
  • Posts: 82
  • Joined: 02-November 13

Re: how to convert dataset to list

Posted 27 November 2013 - 06:14 AM

Hi andrews,

Thanks. It is working now
Was This Post Helpful? 0
  • +
  • -

#17 vivek20055  Icon User is offline

  • D.I.C Head

Reputation: -7
  • View blog
  • Posts: 82
  • Joined: 02-November 13

Re: how to convert dataset to list

Posted 27 November 2013 - 06:36 AM

Hi andrews,

I am using something to compare two rows in excel.

I want to compare the rows until the data exists in row of excel

n < xlWorkSheet.Cells[n, 2].length means until the data exists in 2nd row of excel.

for (int n = 0; n < xlWorkSheet.Cells[n, 2].length; n++)
           {

               if (p < xlWorkSheet.Cells[n, 2].length)
                   p++;

               if ((xlWorkSheet.Cells[p, 1].Value.ToString()).Equals((xlWorkSheet.Cells[n, 2].Value.ToString())))
               //if (string.Compare(xlWorkSheet.Cells[22, 1], xlWorkSheet.Cells[10, 2]))
               {
                   xlWorkSheet.Cells[m, 4] = xlWorkSheet.Cells[n, 2];
                   m++;
               }


           }


But I am getting error at n < xlWorkSheet.Cells[n, 2].length with a exception.


Thanks
John

This post has been edited by vivek20055: 27 November 2013 - 06:37 AM

Was This Post Helpful? 0
  • +
  • -

#18 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3573
  • View blog
  • Posts: 11,112
  • Joined: 05-May 12

Re: how to convert dataset to list

Posted 27 November 2013 - 07:25 AM

What's the exception you are getting?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2