Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8509

Re: is it posssible to Import Excel as object and browse through each rows to compare Data

$
0
0

Hi sree,

Of course you can. You have few possibilities, I will mention 3 here.

  1. Read the Excel file with the ACE/JET driver. You will get a recordset  which you can then browse. This is suitable only for excel file having the data in a table format, and you are sure of each of the columns data type
  2. Reference the Excel.Exe object. And use it in your code. You can then read the excel values by cell address. This has a shortfall though. Your client needs to have exact excel version with the version you are referencing.
  3. Late bind the Excel object and harness the power of dynamic data type in C# introduced in C# 3.5. This is the same as point 2. But without the shortfall above. It should work with any excel version, the down side is no intelisense.

 

 

What I usually do is to use 2nd point during the development (this way I get the intellisense) and then before deployment, switch it to late bind the object (point 3)

 

Regards
Edy


Viewing all articles
Browse latest Browse all 8509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>