比较excel表使用C#+ Source控件之类的功能 [英] Comparing excel sheets using C# + Source control like functionality

查看:93
本文介绍了比较excel表使用C#+ Source控件之类的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

Hello All,

我计划在Excel工作表中实现类似功能的源代码。我应该abe输入任何两个excel文件,我应该能够获得ExcelCompare或DiffCompare之类的差异。

I am planning to implement a source code like functionality when it comes to Excel sheets. I should be abe to input any two excel files and I should be able to obtain the differences like ExcelCompare or DiffCompare.

无论新添加到Excel工作表中的行是什么行,已编辑,已添加的任何新列,已移动的任何列。

Whatever rows are newly added to the excel sheet, whatever rows which have been edited, any new columns which have been added, any columns which have been moved.

换句话说,我希望在XLS文件上具有比较源控件等功能。任何人都可以帮我解决这个问题。

In other words, I would like to have a functionality like Compare of Source Controls on XLS File. Can anyone help me on how to achieve this.

尝试使用DataRelation和DataTable来比较数据,但是这个解决方案对我来说不太好,任何人都可以帮忙。

Tried using DataRelation and DataTable for comparing the data, but that solution looks not so good to me, can anyone help.

谢谢

推荐答案

有很多方法可以做到这一点。  ;我不推荐使用一种方法或其他方法,但您应该考虑将工作簿作为连接打开,并使用SQL语句来查看下面的网页

There are a number of ways of doing this.  I'm not recommending one method or another method but you should consider opening the workbook as a connection and using SQL statementts liek the webpage below

http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx

由于您使用的是Visual Studio,并且可能使用的API库与VBA代码相比速度较慢; SQL比较会更快。

Since you are using visual Studio and probably using the API library which is slow compared to VBA code; the SQL comparision will be much quicker.

 


这篇关于比较excel表使用C#+ Source控件之类的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆