社区
C#
帖子详情
把EXCEL导入oracle数据库
fangpengyu
2010-06-07 06:14:55
怎样从excel读取指定行和列的数据,然后写入数据库中,最好有CODE,谢谢!
...全文
81
4
打赏
收藏
把EXCEL导入oracle数据库
怎样从excel读取指定行和列的数据,然后写入数据库中,最好有CODE,谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
请叫我卷福
2010-06-07
打赏
举报
回复
将excel当做access数据库。。。。
连接字符串(excel2003)"provider=MicroSoft.Jet.Oledb.4.0;extended Properties='excel 8.0';Data Source="+Path;
读取数据表(sheet1、sheet2)中的数据到DataSet中。。。
将DataSet中指定的行和列 插入Oracle。。。
wuyq11
2010-06-07
打赏
举报
回复
打开excel模板,遍历获取
sheet=(Excel._Worksheet)book.Worksheets[1];
for(int i=1;i<=sheet.Rows.Count;i++)
{}
wuzhicheng5
2010-06-07
打赏
举报
回复
1楼的方法,可以尝试哦
朝日格图
2010-06-07
打赏
举报
回复
/// <summary>
/// 生成Excel表的内部表名称集合
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
private void ImportTableNames(string filename)
{
Filename = filename;
string xls_source = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Filename + ";" + "Extended Properties=Excel 8.0;";
OleDbConnection xls_con = new OleDbConnection(xls_source);
xls_con.Open();
try
{
DataTable schematable = xls_con.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
TableNames = new string[schematable.Rows.Count];
for (int i = 0; i < schematable.Rows.Count; i++)
{
TableNames[i] = schematable.Rows[i][2].ToString();
}
}
catch (Exception ex)
{
MessageBox.Show(filename + ex.Message, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
}
xls_con.Close();
//return m_tablenames;
}
/// <summary>
/// 生成Excel表相对应的导入表
/// </summary>
/// <returns></returns>
public override DataTable InportTable(string filename, string tablename)
{
OutTable = new DataTable();
if (filename.Equals(""))
MessageBox.Show("必须选择一个要导入的文件", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
string source = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filename + ";" + "Extended Properties=Excel 8.0;";
OleDbConnection xls_con = new OleDbConnection(source);
xls_con.Open();
string xls_select = "";
OleDbDataAdapter xls_Command = null;
xls_select = "select * from [" + tablename + "]";
xls_Command = new OleDbDataAdapter(xls_select, xls_con);
try
{
DataTable dt = new DataTable();
dt.Clear();
xls_Command.Fill(dt);
OutTable = dt;
}
catch (Exception ex)
{
MessageBox.Show(filename + ex.Message, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
}
xls_con.Close();
return OutTable;
}
Excel
通过plsql
导入
oracle
数据库
本文介绍了三种将
Excel
数据
导入
Oracle
数据库
的方法:1) 直接复制粘贴到表中,2) 使用ODBC
导入
器,3) 利用文本
导入
器。详细步骤包括设置FOR UPDATE锁定、创建ODBC数据源、将
Excel
另存为txt文件等操作。
Excel
导入
Oracle
数据库
C#winform完整代码
本文介绍了一种将
Excel
数据
导入
Oracle
数据库
的方法。首先通过OLE DB连接读取
Excel
文件,并将其内容填充到DataSet中。然后使用
Oracle
Command和事务处理将DataSet中的数据逐条插入到指定的
数据库
表中。
如何将
EXCEL
表
导入
ORACLE
数据库
中?【转】
本文详细介绍了如何将
Excel
数据
导入
Oracle
数据库
的步骤,包括使用PL/SQL Developer的Text Importer工具,以及通过编程方式如NPOI库进行数据
导入
。此外,还提到了TOAD工具的使用方法和解决
导入
过程中的格式问题。
oracle
如何
导入
excel
数据库
文件,如何将
excel
导入
oracle
数据库
的教程
本文介绍了一种将
Excel
数据
导入
Oracle
数据库
的方法。通过将
Excel
转换为CSV格式并使用SQL*Loader工具,可以轻松地将数据加载到指定的
Oracle
表中。教程详细介绍了从
Excel
文件准备到最终数据验证的整个过程。
c#
导入
excel
到
oracle
数据库
,
Excel
导入
Oracle
数据库
C#winform完整代码
这篇博客介绍了一种使用C#将
Excel
数据
导入
Oracle
数据库
的方法。通过创建DataSet,利用OleDbDataAdapter填充从
Excel
读取的数据,然后开启事务进行
数据库
的批量插入操作。代码示例展示了如何打开
Excel
文件、读取数据并执行
数据库
插入。
C#
111,129
社区成员
642,535
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章