喷气发动机 - 255字符截断 [英] Jet Engine - 255 character truncation

查看:150
本文介绍了喷气发动机 - 255字符截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要导入的Excel US preadsheet到我的程序,并具有以下code:

I'm needing to import an Excel spreadsheet into my program and have the following code:

string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;IMEX=1;HDR=NO;""", MyExcelFile.xls);

command.CommandText = "SELECT * FROM [Sheet1$]";

(注意,code以上不是真正的code,但应该让你看到我在做什么)

(Note, code above isn't real code but should let you see what I'm doing)

我收到的文件中导入,唯一的问题是在Excel工作表这是超过255个字符被截断的列。

I'm getting the file imported, only problem is any columns in the Excel sheet which are over 255 characters are being truncated.

有没有解决这个发生什么办法?

Is there any way around this happening?

我读的地方,如果你确保有在第8行中列长行文字,那么它将被视为一个备注字段,因此不会截断,但似乎并没有工作。

I read somewhere that if you make sure there is a long line of text in the column within the first 8 rows, then it will be treated as a memo field and therefore not truncated but that didn't seem to work.

任何想法?

格雷姆

推荐答案

可能是你的问题有一个简单的解决方案,但作为最后的手段,尽量节省你的Excel文件为CSV文本文件,然后使用普通文件处理它和字符串操作类,而不是JET引擎。

Probably your problem has an easier solution, but as a last resort, try to save your Excel file as a CSV text file, then process it using the regular file and string manipulation classes instead of the JET engine.

这篇关于喷气发动机 - 255字符截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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