是否可以设置两个Excel表之间的外键? [英] Is it possible to set foreign key between two excel sheets?

查看:1795
本文介绍了是否可以设置两个Excel表之间的外键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能设置外键之间的两个Excel从两片表和查询记录?

Is it possible to set foreign key between two excel sheets and query records from the two sheets?

我得到了学生的详细Excel工作表,另一个表包含占总成绩的。通用的板材领域是REGID。我需要显示从网格中的两片的名称和标志......怎么能做到呢?请帮助....

I got an excel sheet of Student Details and another sheet consists of the total marks. Fields common to both the sheet is the RegID. I need to display the Name and Marks from the two sheets on a grid...How can it be done? please help....

查询=从[查看$]作为一个LEFT JOIN [UI $]为B上。[负责人]选择状态= B [负责人]其中b [负责人] = NULL。

Query = "SELECT Status from [Viewer$] as a LEFT JOIN [UI$] as b ON a.[Responsible Person] = b.[Responsible Person] where b.[Responsible Person] = null" ;

这查询不返回记录的数据集...

This query is not returning the records to a dataset...

推荐答案

新手,

我用Excel 2007中OPENXML SDK( DocumentFormat.OpenXml ),在这种情况下有很大的影响。这基本上是一个LINQ库,需要将Excel文档到对象,并让你的C#里面查询,就像任何其他LINQ的对象。微软其实也有一个不错的傻瓜指南关于这一主题(快速搜索后)。你可以在这里找到它:

I've used the excel 2007 openxml sdk (DocumentFormat.OpenXml) to great effect in this scenario. It's basically a LINQ library that takes the excel docs into objects and allows you to query inside c# just like any other LINQ object. Microsoft actually do have (after a quick search) a pretty good 'idiots guide' on this topic. You can find it here:

- 增加了一些更多的链接

[edit] - added a few more links

http://msdn.microsoft.com /en-us/library/dd920313%28v=office.12%29.aspx

http://blogs.msdn.com/b/johnrdurant/archive/ 2010/02/19 / Excel的开放XML的LINQ的部分i.aspx

http://www.briankeating.net/blog/post/2010/04/26/Linq-to -Xlsx.aspx

如果你使用LINQ,这是没有道理的,是肯定,我会与这种类型的任务的唯一的出路。它还FK的的'迎合'你的想法,因为它可以让你对你的关心定义(即与任何LINQ查询)任何arbitary领域加入会的,因此它应该完全满足您的要求。

if you use LINQ, it's a no brainer and is definately the only way that I would go with this type of task. It will also 'cater' for you idea of fk's as it will allow you to 'join' on any arbitary field that you care to define (i.e. as with any LINQ query), thus it should address your requirement perfectly.

这篇关于是否可以设置两个Excel表之间的外键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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