importrow --> update fails

Mischamel

Regular
Joined
Apr 17, 2003
Location
Switzerland - Rome - Darmstadt
Hi,

when I Import a row like (Dataset.table.importrow(iRow)), which is also shown in my datgrid after importing, it isn´t affected on updating my Datasource. Otherwise, when I use Me.Databinding(***).removeat(int) in the same dataset, the update takes place and is also visible in my datagrid.
#
Any idea why ???
 

Mischamel

Regular
Joined
Apr 17, 2003
Location
Switzerland - Rome - Darmstadt
Now I receive an errmsg like this(translated): Insert Row not possible. This Row already belongs to another table.

I got several tables in my Db with a similar structure and no relations are set.

Can´t find help in msdn or knowledge base.
 

Mischamel

Regular
Joined
Apr 17, 2003
Location
Switzerland - Rome - Darmstadt
Solved !!!!

Hey jou !!!

I did it !!!!!

I took your suggest as written above, wich didn´t work properly at first for me. But the Parameter made it. Instead of a DataRow, the method also accepts an Object of values to add. So I put the row of my source table into an ObjectArray(lots of code) and took it as parameter for the **.add() method.

Watch this :

Dim DRow(24) As Object
Dim myRow As DataRow
myRow = Dataset_PAM1.PAM.Item(ctr)
REM Put colfield in Array field
DRow(0) = myRow("TicketID") REM colname
DRow(1) = myRow("Name") REM Do this until all cols are filled in Array -- and finally :

objDataset1.Tables("TABLENAME").Rows.Add(DRow)


I don´t know why, but it works fine now. No idea why alternatives above failed.

So what. Thanks for your help. Hope Topic will give advise to someone else later in a galaxy far far away ..... :D
 
Top Bottom