new records in relational datatables

isaacmountain

New Member
Hello, <BR><BR>I've got two related dataTables in a single dataset and am having a strange issue with inserting new rows into each. If the dataset doesn't exist in cache then it creates the two tables, sets the primary key, and adds the relation. Otherwise the system is supposed to add a new record to both tables. This is all working fine, except it's refusing to add the row to my child table (linkTable). I'm fairly certain it's a syntax issue, but I'm not getting any errors, it just does nothing. <BR><BR>Here is the code to add new rows if the set is in cache:<BR><BR> dim pageSet AS dataSet = Cache.Get("sitePageSet") <BR><BR> dim pageTable AS dataTable = pageSet.Tables("pageTable")<BR> dim nextPageRow AS dataRow<BR><BR> nextPageRow = pageTable.NewRow()<BR> nextPageRow("pageName") = newPage<BR> pageTable.Rows.Add(nextPageRow) <BR> <BR> dim linkTable AS dataTable = pageSet.Tables("linkTable")<BR> dim nextLinkRow AS dataRow<BR> <BR> nextLinkRow = linkTable.NewRow()<BR> nextLinkRow("templateID") = lstTemplates.SelectedItem.Value<BR> nextLinkRow("slotID") = curSlotID.Value<BR> linkTable.Rows.Add(nextLinkRow)<BR> <BR> cache.Insert("sitePageSet", pageSet)<BR><BR><BR>Any help? <BR><BR>Thanks,<BR><BR>])ry<BR>
 
Back
Top