Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. can't find childrows....

can't find childrows....

Scheduled Pinned Locked Moved Database
data-structuresquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gericooper
    wrote on last edited by
    #1

    Hi Don't know what's wrong with my code(below), it runs but doesn't return any childrows( however exists -childrows.length=0- & identified by parent rows ID). Dataset was created by wizard, table & nested table in the dataset browser exist. I don't have any idea left... Thanks for your posts in advance, g
    private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (Validate() && uzemanyagBindingSource != null) { bool deleteRow = true; DataRowView rowView = uzemanyagBindingSource.Current as DataRowView; if (rowView == null) { return; } Debmut9DataSet.UzemanyagRow row = rowView.Row as Debmut9DataSet.UzemanyagRow; Debmut9DataSet.GepRow[] ChildRows = row.GetGepRows(); if (ChildRows.Length > 0) { DialogResult userChoice = MessageBox.Show("All records in this & realted table will be deleted.Continue?", "Delete...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (userChoice == DialogResult.Yes) { foreach (Debmut9DataSet.GepRow childuzemanyag in ChildRows) { childuzemanyag.Delete(); } } else { deleteRow = false; } } if (deleteRow) uzemanyagBindingSource.RemoveCurrent(); uzemanyagBindingSource.EndEdit(); Array.Resize(ref uzemanyagregiar, uzemanyagBindingSource.List.Count); }

    G 1 Reply Last reply
    0
    • G gericooper

      Hi Don't know what's wrong with my code(below), it runs but doesn't return any childrows( however exists -childrows.length=0- & identified by parent rows ID). Dataset was created by wizard, table & nested table in the dataset browser exist. I don't have any idea left... Thanks for your posts in advance, g
      private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { if (Validate() && uzemanyagBindingSource != null) { bool deleteRow = true; DataRowView rowView = uzemanyagBindingSource.Current as DataRowView; if (rowView == null) { return; } Debmut9DataSet.UzemanyagRow row = rowView.Row as Debmut9DataSet.UzemanyagRow; Debmut9DataSet.GepRow[] ChildRows = row.GetGepRows(); if (ChildRows.Length > 0) { DialogResult userChoice = MessageBox.Show("All records in this & realted table will be deleted.Continue?", "Delete...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (userChoice == DialogResult.Yes) { foreach (Debmut9DataSet.GepRow childuzemanyag in ChildRows) { childuzemanyag.Delete(); } } else { deleteRow = false; } } if (deleteRow) uzemanyagBindingSource.RemoveCurrent(); uzemanyagBindingSource.EndEdit(); Array.Resize(ref uzemanyagregiar, uzemanyagBindingSource.List.Count); }

      G Offline
      G Offline
      gericooper
      wrote on last edited by
      #2

      Think I got it I forgot to fill the child table, upon the load event of the form whose control is bound to parent table. so the classic: childtableadapter.fill (dataset.childtable)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups