L
Larry
Below is code using the Oracle Data Adaptor and VB.NET.
All I am trying to do is make 100 insertions into the database.
From the time of the first "Console.WriteLine" until the last one
is 15 seconds. That is way too long for 100 insertions.
Can anyone see what I am doing wrong and what a fix might be?
=================================================================
Imports System
Imports Oracle.DataAccess.Client
Sub Main()
Dim constr As String = "User Id=user;Password=password;Data Source=data"
Dim con As New OracleConnection(constr)
Dim SQL As String
Dim cmd As New OracleCommand
Dim X As Integer
con.Open()
cmd.Connection = con
cmd.CommandType = CommandType.Text
For X = 1 To 100
SQL = "insert into test values ('1','2')"
cmd.CommandText = SQL
Console.WriteLine(SQL)
cmd.ExecuteReader()
Next
cmd.CommandText = "commit"
cmd.ExecuteReader()
cmd.Dispose()
con.Close()
con.Dispose()
End Sub
All I am trying to do is make 100 insertions into the database.
From the time of the first "Console.WriteLine" until the last one
is 15 seconds. That is way too long for 100 insertions.
Can anyone see what I am doing wrong and what a fix might be?
=================================================================
Imports System
Imports Oracle.DataAccess.Client
Sub Main()
Dim constr As String = "User Id=user;Password=password;Data Source=data"
Dim con As New OracleConnection(constr)
Dim SQL As String
Dim cmd As New OracleCommand
Dim X As Integer
con.Open()
cmd.Connection = con
cmd.CommandType = CommandType.Text
For X = 1 To 100
SQL = "insert into test values ('1','2')"
cmd.CommandText = SQL
Console.WriteLine(SQL)
cmd.ExecuteReader()
Next
cmd.CommandText = "commit"
cmd.ExecuteReader()
cmd.Dispose()
con.Close()
con.Dispose()
End Sub