简体   繁体   English

C#,OLEDB从指定行读取Excel文件

[英]C#, OLEDB reading a Excel file from a specified row

I need to read a table in an Excel file starting from 10th row (rows before 10th row are having other data and they are not in a correct format and coteins banners, cell splits, ect) using Ado.Net. 我需要使用Ado.Net从第10行开始读取Excel文件中的表(第10行之前的行有其他数据,并且它们的格式不正确,coteins横幅,单元格拆分等)。 How can I do that? 我怎样才能做到这一点?

It's all here: How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET . 它就在这里: 如何使用ADO.NET使用Visual Basic .NET在Excel工作簿中检索和修改记录 The article contains code samples for to VB.NET, but the C# code shouldn't be too difficult to deduce. 本文包含了VB.NET的代码示例,但C#代码不应该太难推断。

Pay particular attention to the section specifying Table Naming Conventions 请特别注意指定表命名约定的部分

Thanks all for your help. 感谢你的帮助。 Specially Simen . 特别是西门子 I've managed to find a solution for my problem with some help from this article: OleDb connection to Excel; 在本文的帮助下,我设法找到了解决问题的方法: OleDb连接到Excel; how do I select fixed width, unbounded height? 如何选择固定宽度,无界高度?

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

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