Mischamel Posted March 8, 2004 Posted March 8, 2004 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 ??? Quote Sometimes you´ve got to make a silent Takedown .
georgepatotk Posted March 9, 2004 Posted March 9, 2004 update the dataset after importing, for example, dadapter.update(dset) Quote George C.K. Low
Mischamel Posted March 9, 2004 Author Posted March 9, 2004 For sure I do the update after the import of the rows. The update on removed rows works, but on the imported ones it doesn´t take effect. Quote Sometimes you´ve got to make a silent Takedown .
Leaders quwiltw Posted March 9, 2004 Leaders Posted March 9, 2004 ImportRow doesn't make the row "dirty" with the RowState property, you might want to try using LoadDataRow instead. Quote --tim
Mischamel Posted March 9, 2004 Author Posted March 9, 2004 LoadDataRow has the same effect as importmethod . Still not updating source table Quote Sometimes you´ve got to make a silent Takedown .
*Experts* Nerseus Posted March 9, 2004 *Experts* Posted March 9, 2004 Maybe try ds.Tables[0].Rows.Add(datarow) instead of ImportRow? -nerse Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
georgepatotk Posted March 10, 2004 Posted March 10, 2004 I do suggest the way of doing it with ds.Tables[0].Rows.Add(datarow). Quote George C.K. Low
Mischamel Posted March 10, 2004 Author Posted March 10, 2004 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. Quote Sometimes you´ve got to make a silent Takedown .
georgepatotk Posted March 10, 2004 Posted March 10, 2004 can you please paste your code? Quote George C.K. Low
Mischamel Posted March 10, 2004 Author Posted March 10, 2004 myRow = Dataset_PAM1.PAM.Item(ctr) objDataset1.Tables("PAMListe").Rows.Add(myRow) After ***.add(myRow) error occurs. :o Quote Sometimes you´ve got to make a silent Takedown .
Mischamel Posted March 10, 2004 Author Posted March 10, 2004 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 Quote Sometimes you´ve got to make a silent Takedown .
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.