c# winform 中导入Excel 的问题 !
2014-08-11 10:16
543 查看
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" EXCEL的本地路径 ";Extended Properties=Excel 8.0;"); conn.Open(); string strExcel = ""; OleDbDataAdapter myCommand = null; strExcel = string.Format("select '号码' from [这里填你的EXCEL左下角的工作表名$]"); myCommand = new OleDbDataAdapter(strExcel,conn); DataTable dt=new DataTable(); myCommand .Fill(dt);//把所有结果填充到dt里面 string rusult="": for(int i=0;i<dt.Row.count;i++) { rusult+=dt.Rows[i][0].ToString()+";";//遍历所有号码相加 } textbox1.Text=rusult;
相关文章推荐
- Excel导入Oracle数据库C#winform完整代码
- c# 导入excel (和文字被截断问题)
- C# 导入excel数据,解决关闭excel后不能释放资源的问题
- ASP.NET(C#)Excel导入Dataset的出现数据值丢失问题
- C#数据导入/导出Excel文件及winForm导出Execl总结
- C#解决从含身份证号码的Excel表格导入数据库的问题
- C# Winform里面输出数据到Excel的问题
- C#开发——winform中将Excel数据导入DataGridView
- 【转】C# Excel 导入到 Access数据库表(winForm版)
- C# WINFORM Excel 导入导出 类
- C#导入excel遇到的问题
- C#导入Excel报错问题2。
- C# winform 导出导入Excel/Doc 完整实例教程 使用Aspose.Cells.dll——第一篇
- C#winform多个03Excel导入SQL数据库部分代码
- C# Excel 导入到 Access数据库表(winForm版)
- C# ASP.NET Datagrid导入Excel的问题
- C#导入数据到Excel中遇到的问题,已解决
- (轉載)Excel 文件用C#导入 Access 数字字符混排的问题
- 用c#的OLEDB导入Excel到数据库产生科学计数法问题解决
- c# 导入excel 读取excel数据 多个工作表时 解决科学计数法显示的问题