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. General Programming
  3. C#
  4. DataRow Problem

DataRow Problem

Scheduled Pinned Locked Moved C#
helpdatabasedata-structures
3 Posts 2 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.
  • T Offline
    T Offline
    tatchung
    wrote on last edited by
    #1

    Hello once again! I was wondering why i cant seem to add data to my datarow. here's the code snippet im hoping if you guys could help me out on this one...

    DataTable dt = new DataTable();
    string[] arrEmpIDs = strEmpID.Split(',');
    for (int q=0; q

    the array holds 10 strings and the function works fine (database retrieval). Well the program hangs before dt.Rows.Add(dr); and im totaly clueless why.

    An advance thanx for all your posts! Kampai!!!

    Aim small, miss small...

    J 1 Reply Last reply
    0
    • T tatchung

      Hello once again! I was wondering why i cant seem to add data to my datarow. here's the code snippet im hoping if you guys could help me out on this one...

      DataTable dt = new DataTable();
      string[] arrEmpIDs = strEmpID.Split(',');
      for (int q=0; q

      the array holds 10 strings and the function works fine (database retrieval). Well the program hangs before dt.Rows.Add(dr); and im totaly clueless why.

      An advance thanx for all your posts! Kampai!!!

      Aim small, miss small...

      J Offline
      J Offline
      jonny5
      wrote on last edited by
      #2

      Looks like you are in an infinite loop - is this what you are trying to do? DataTable dt = new DataTable(); string[] arrEmpIDs = strEmpID.Split(','); DataRow dr = dt.NewRow(); for (int q=0; q < arrEmpIDs.Length; q++) { dr[q] = objDSPHContribRep.fgetEmpPhilHealthInfo(arrEmpIDs[q]); } dt.Rows.Add(dr); return dt; Jon Humphreys ActivePlanet Software Bangkok, Thailand

      T 1 Reply Last reply
      0
      • J jonny5

        Looks like you are in an infinite loop - is this what you are trying to do? DataTable dt = new DataTable(); string[] arrEmpIDs = strEmpID.Split(','); DataRow dr = dt.NewRow(); for (int q=0; q < arrEmpIDs.Length; q++) { dr[q] = objDSPHContribRep.fgetEmpPhilHealthInfo(arrEmpIDs[q]); } dt.Rows.Add(dr); return dt; Jon Humphreys ActivePlanet Software Bangkok, Thailand

        T Offline
        T Offline
        tatchung
        wrote on last edited by
        #3

        Hi! Thanx for the post! Im not arguing or anything i was just wondering if i remove dt.Rows.Add(dr); from the loop won't the program just add 1 long row instead of 10 short rows? oh yeah and since the program originaly hangs at dr[q] = objDSPHContribRep.fgetEmpPhilHealthInfo(arrEmpIDs[q]); upon debugging what would prevent it from stalling this time? pardon me for asking so much questions im still new at this and im thankful for al your helps:-D Aim small, miss small...

        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