Home All Groups Group Topic Archive Search About

Dataset updates fewer rows for Binary(blob) fields

Author
10 Oct 2006 11:12 AM
Senthilkumar
Hi,

An application uses Mimer database. There are a few tables which uses Binary
data. Due to the use of binary fields, the database size grows very large
quickly. I am trying to write an application where in we can sort of archive
the data to another database.

I am using the mimer data provider, i could select, copy the data to another
table in the archive database, but only fewer rows are inserted into the
target database. After inserting 3 rows, an error appears 'Character or
Binary string too long ..->Mimer.data.client exception' Each row contains
about 0.5Mb of binary data and the source database contains only 4 rows.

I tried on another table, only 3 rows are copied with the same error. I give
my code below, its self explanatory:

Dim da1, da2 As Mimer.Mpm.Data.MpmDataAdapter
Dim cmd As Mimer.Mpm.Data.MpmCommandBuilder
Dim ds1, ds2 As DataSet
da1 = New Mimer.Mpm.Data.MpmDataAdapter("SELECT * FROM RTSTRUCT", cnn1)
'Set "AcceptChages" to False so that all rows in the DataTable will be seen
as "Added" rows
da1.AcceptChangesDuringFill = False
da1.Fill(ds1, "RTSTRUCT")
da2 = New Mimer.Mpm.Data.MpmDataAdapter("SELECT * FROM RTSTRUCT", cnn2)
'Create a command builder to create the insert statements()
cmd = New Mimer.Mpm.Data.MpmCommandBuilder(da2)
'Set the InsertCommand of your target DataAdapter using the(commandbuilder)
da2.InsertCommand = cmd.GetInsertCommand
Try
'ds2.Merge(ds1, True, MissingSchemaAction.Add)
da2.Update(ds1, "RTSTRUCT")
Catch ex As Exception
MsgBox(ex.ToString)
End Try

Any help & ideas how to improve my code.

Thanks

Senthilkumar

AddThis Social Bookmark Button