rows are there, but can't see them?

Results 1 to 2 of 2

Thread: rows are there, but can't see them?

  1. #1
    Join Date
    Dec 1969

    Default rows are there, but can't see them?

    The following code is returning a count value of zero (which means, I think, that the loop isn&#039;t being entered), despite the fact that I know dtblSource has several rows of information in it.<BR>Help would be appreciated. I can&#039;t figure out why this is the case.<BR><BR>sub Fill_Table (dtmDate As DateTime, dsOrgAVail As DataSet, dtblSource As DataTable, dtblTarget As DataTable)<BR> &#039;fill org column<BR> &#039;loop<BR> Dim row AS DataRow<BR> Dim strActiveOrg As String = ""<BR> Dim strActivePos As String = ""<BR> Dim bolFound As Boolean = false<BR> Dim index As Integer = 0<BR> Dim colArrayList As ArrayList = New ArrayList()<BR> Dim strCompoundPos As String = ""<BR> Dim count As Integer = 0<BR><BR> for each row in dtblSource.rows<BR> &#039;retrieve a row<BR> count = count + 1<BR> strActiveOrg = row("Org")<BR> strActivePos = row("Position")<BR> Dim arrCompoundPos() As String = {strActiveOrg,strActivePos}<BR> strCompoundPos = String.Join("/",arrCompoundPos)<BR> if NOT colArrayList.Contains ("strCompoundPos") then<BR> colArrayList.Add("strCompoundPos")<BR> end if<BR> next row<BR> colArrayList.Sort<BR> lblMessage.text=count<BR> lblMessage.DataBind()<BR> lstMessage.DataSource=colArrayList<BR> lstMessage.DataBind()<BR> colArrayList.Sort<BR> <BR> &#039;add array as org and position columns to dtblTarget<BR> for each strCompoundPos in colArrayList<BR> Dim arrCompoundPos = strCompoundPos.Split("/")<BR> strActiveOrg = arrCompoundPos(0)<BR> strActivePos = arrCompoundPos(1)<BR> Dim activeRow As DataRow = dtblTarget.NewRow()<BR> activeRow("Org") = "strActiveOrg"<BR> activeRow("Position") = "strActivePos"<BR> next strCompoundPos<BR> <BR> &#039;fill date columns<BR>end sub

  2. #2
    Join Date
    Dec 1969

    Default how can u be so sure!

    have u tried to check the property dtblSource.Rows.count to c if really there r rows or not?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts