Page 1 of 1

Repeating Data

Posted: Wed Apr 01, 2009 6:51 am
by raj07
Hi.. currently i am getting data like

,Apple,banana,Orange,Apple,,Orrange,Grapes,Mango,Guva,,Apple,Orrange

in my data table there are some null value wich also printing and some repeated value also getting printed.
i want to remove the Blank Data and the Repeating data from the Detail... how can i print my data just single like this..

Apple,Orange,Guva,Grapes,Banana

plzz do reply need help...
Thank You.

Repeating Data

Posted: Wed Apr 01, 2009 1:47 pm
by Jan
Hello,

You can use hashtable to hide duplicated values.

Thank you.

Repeating Data

Posted: Thu Apr 02, 2009 4:22 am
by raj07
but whare should i put Hashtable

in the Datasource or TextField of data printing..

explain it iwth proper....plzz Thank oYou

Repeating Data

Posted: Fri Apr 03, 2009 6:45 am
by raj07
hii.. JAN what happen y r u not replyinn....??
plzz reply... :dumb:

Repeating Data

Posted: Fri Apr 03, 2009 8:40 am
by Jan
Hello,

You can use following code:

Code: Select all

Me.Categories.First
    Dim hashtable As New System.Collections.Hashtable
    Do While Not Me.Categories.get_IsEof
        hashtable.Item(Me.Categories.CategoryName) = Me.Categories.CategoryName
        Me.Categories.Next
    Loop
    Dim str As String = ""
    Dim obj2 As Object
    For Each obj2 In hashtable.Keys
        If (str = "") Then
            str = obj2.ToString
        Else
            str = (str & ";" & obj2.ToString)
        End If
    Next
    e.Value = str
Thank you.