【发布时间】:2017-04-10 18:26:08
【问题描述】:
我正在尝试从输入流中读取一个 excel 文件。
我想逐行读取并将列信息从 Excel 保存到数据库。
我无法读取文件,谁能帮我弄清楚我缺少什么。
这是下面的代码。
using (System.IO.BinaryReader sr = new System.IO.BinaryReader(fileToUpload.PostedFile.InputStream))
{
do
{
tester.Text = tester.Text + sr.ReadString() + "</br>";
} while (sr.PeekChar() > 0);
}
谢谢 卡提克
【问题讨论】:
-
搜索如何使用 C# 读取 excel 文件。 stackoverflow.com/search?q=Read+excel+file+c%23
-
我们的服务器没有microsoft office DLL,也不允许安装第三方库。所以我试图使用 Binarystream 来实现。如果有其他方法可以尝试,请告诉我
标签: excel binary binarystream