How to compare datatable and excel

Class library usage, coding and language questions.
Posts: 1
Joined: Thu Jul 09, 2015 3:37 pm

How to compare datatable and excel

Post by Parimala » Thu Jul 09, 2015 4:12 pm

Hi there,

I have a datatable created by opening a Db connection and retrieving data from a table, I now want to compare data within datatable with data in excel (this is my data source) and write out differences into another worksheet in the same excel. Can you please help me acheive this? I need solution asap.

Alternatively, is there a way to compare data from datatable generated by databaseSqlconnector with data in excel and write differences into worksheet?

Thanks in advance.

User avatar
Ranorex Guru
Ranorex Guru
Posts: 6553
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to compare datatable and excel

Post by odklizec » Mon Jul 13, 2015 8:04 am


There is no built-in way to achieve what you want. You will have to code something up.

I would suggest you to start with these samples: ... html#c7787 ... html#c7781
You will have to adapt either of these samples to work with Excel/DB data connector. You can find many code examples of working with Excel data connectors around this forum. Just try to search them.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration