Y
Yo
I have a database in SQL Server and I connect myself to this to pass the
data from a table to SQL Server CE but when 498 registrations go it sends me
an error and not continuous.
Which could be the problem ??
The code that I use is the following
Dim cmd As System.Data.SqlClient.SqlCommand
Dim dtr As System.Data.SqlClient.SqlDataReader
Dim oConn As System.Data.SqlClient.SqlConnection
oConn = New System.Data.SqlClient.SqlConnection("user
id=pocket;password=12345;database=pocketCE;server=10.21.109.5")
oConn.Open()
cmd = New System.Data.SqlClient.SqlCommand("Select codani, nomani
from hoja", oConn)
dtr = cmd.ExecuteReader()
Dim oConnCE As New SqlCeConnection("Data Source = \My
Documents\prueba.sdf")
Dim SQLUpd As SqlCeCommand = oConnCE.CreateCommand()
Dim cCod, cNom As String
oConnCE.Open()
While dtr.Read()
cCod = dtr("codani")
cNom = dtr("nomani")
SQLUpd.CommandText = "INSERT INTO Animal VALUES('" & Trim(cCod)
& "','" & Trim(cNom) & "')"
SQLUpd.ExecuteNonQuery()
End While
MsgBox("ok")
oConnCE.Close()
data from a table to SQL Server CE but when 498 registrations go it sends me
an error and not continuous.
Which could be the problem ??
The code that I use is the following
Dim cmd As System.Data.SqlClient.SqlCommand
Dim dtr As System.Data.SqlClient.SqlDataReader
Dim oConn As System.Data.SqlClient.SqlConnection
oConn = New System.Data.SqlClient.SqlConnection("user
id=pocket;password=12345;database=pocketCE;server=10.21.109.5")
oConn.Open()
cmd = New System.Data.SqlClient.SqlCommand("Select codani, nomani
from hoja", oConn)
dtr = cmd.ExecuteReader()
Dim oConnCE As New SqlCeConnection("Data Source = \My
Documents\prueba.sdf")
Dim SQLUpd As SqlCeCommand = oConnCE.CreateCommand()
Dim cCod, cNom As String
oConnCE.Open()
While dtr.Read()
cCod = dtr("codani")
cNom = dtr("nomani")
SQLUpd.CommandText = "INSERT INTO Animal VALUES('" & Trim(cCod)
& "','" & Trim(cNom) & "')"
SQLUpd.ExecuteNonQuery()
End While
MsgBox("ok")
oConnCE.Close()