B
Bart
Hi,
i get the error:
"There is already an open DataReader associated with this Command which must
be closed first"
Thanks
Bart
-----------------------------------------
Imports System.Data.sqlclient
Imports System.Data
....
....
sql = "SELECT count(*) FROM pc where lokl='" & w & "';"
comd = New SqlCommand(sql, oConnection)
recpc = comd.ExecuteScalar
sql = "SELECT pcnr FROM pc where lokl='" & w & "';"
comd = New SqlCommand(sql, oConnection)
dtreader = comd.ExecuteReader
for j = 1 To recpc
dtreader.Read()
ww = dtreader.GetValue(0)
sql = "INSERT INTO mytable (field1 values(" & ww & ")"
comd.ExecuteNonQuery()
Next
dtreader.Close()
---------------------------------------------------------------
i get the error:
"There is already an open DataReader associated with this Command which must
be closed first"
Thanks
Bart
-----------------------------------------
Imports System.Data.sqlclient
Imports System.Data
....
....
sql = "SELECT count(*) FROM pc where lokl='" & w & "';"
comd = New SqlCommand(sql, oConnection)
recpc = comd.ExecuteScalar
sql = "SELECT pcnr FROM pc where lokl='" & w & "';"
comd = New SqlCommand(sql, oConnection)
dtreader = comd.ExecuteReader
for j = 1 To recpc
dtreader.Read()
ww = dtreader.GetValue(0)
sql = "INSERT INTO mytable (field1 values(" & ww & ")"
comd.ExecuteNonQuery()
Next
dtreader.Close()
---------------------------------------------------------------