简体   繁体   English

使用SSIS在vb.net中读取合并的Excel数据

[英]Reading merged excel data in vb.net using ssis

I got into a tricky issue here. 我在这里遇到了一个棘手的问题。 I am working with SSIS tool set to import data from certain files. 我正在使用SSIS工具集来从某些文件导入数据。 One of these is an excel spreadsheet. 其中之一是Excel电子表格。 The problem is while picking data from merged cells. 问题是从合并的单元格中选择数据时。 Here is a detailed version of the issue - 这是问题的详细版本-

RowNo ColA ColB 1 Value1 行编号ColA ColB 1值1
2 XYZ 2 XYZ

In the above example, Value1 is merged across row 1 & 2. I am looking to pick up value in ColB irrespective of whether the value in ColA is merged or not. 在上面的示例中, Value1跨行1和2合并。无论ColA中的值是否已合并,我都希望在ColB中提取值。 Curerntly this doesn't happen in my code. 目前,这在我的代码中不会发生。

Further details - I am using Microsoft.Jet.OLEDB.4.0 as a provider to form a connection. 更多详细信息-我使用Microsoft.Jet.OLEDB.4.0作为提供程序来形成连接。 Using a select query to fetch data - SELECT ColA FROM WHERE CoLB='XYZ' 使用选择查询来获取数据-SELECT ColA FROM WHERE CoLB ='XYZ'

I would expect this to return Value1 which obviously is not hapening since it is merged across two rows. 我希望它返回Value1 ,因为它已合并到两行中,因此显然不会发生错误。

Can someone please help on this one. 有人可以帮忙吗? This is really taking a toll!! 这真的是要付出代价的!!

Created a VB code to capture the merged cell value separately. 创建了一个VB代码以分别捕获合并的单元格值。 Then looped again to get the other values and updated a virtual dataset with these values. 然后再次循环以获取其他值,并使用这些值更新虚拟数据集。 A little slow, but it works for me!! 有点慢,但是对我有用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM