Oracle数据库数据的批量插入(2)_Oracle数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

Oracle 数据的批量插入(2)

作者:黑客防线网安Oracle维护基地 来源:黑客防线网安Oracle维护基地 浏览次数:0

本篇关键词:Oracle数据库Oracle教程
黑客防线网安网讯:     26          End While27          sw.Stop()28          Loger.Info("Reading z02j form sql sever used", sw.Elapsed.TotalSeconds.ToString()) 二,采用 DataAdapter 实现批量插入 ...

     26          End While

27          sw.Stop()

28          Loger.Info("Reading z02j form sql sever used", sw.Elapsed.TotalSeconds.ToString())

 


采用 DataAdapter 实现批量插入

 


VB.NET

 1          sw.Start()

 2          ''''Read Z02J from SQL Server

 3          Dim sqlCmd As New SqlCommand()

 4          sqlCmd.Connection = sqlConnection

 5          sqlCmd.CommandText = "SELECT * FROM   Z02J"

 6

 7          Dim sqlDr As SqlDataReader

 8          sqlDr = sqlCmd.ExecuteReader()

 9

10          Dim cmdInsertZ02J As New OracleCommand()

11          cmdInsertZ02J.Connection = oraConnection

12          cmdInsertZ02J.CommandText = BuildSQLStatement(SQLType.Insert,"z02j")

13

14          Dim dtSqlZ02J As New DataTable

15          dtSqlZ02J.Columns.Add("plantLever")

16          dtSqlZ02J.Columns.Add("material")

17          dtSqlZ02J.Columns.Add("oldMaterialNum")

18          dtSqlZ02J.Columns.Add("materialDescription")

19

20          Dim plantLever, material, oldMaterialNum, materialDescription As Object

21          While sqlDr.Read()

22              plantLever = ReadSqlDataReader(sqlDr, 0, "")

23              material = ReadSqlDataReader(sqlDr, 1, "")

24              oldMaterialNum = ReadSqlDataReader(sqlDr, 2, "")

25              materialDescription = ReadSqlDataReader(sqlDr, 3, "")

26              dtSqlZ02J.Rows.Add(plantLever, material, oldMaterialNum, materialDescription)

27          End While

28          sw.Stop()

 

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-12965-1.html
网站维护教程更新时间:2012-03-23 00:48:40  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer