I want to display datatable result in a label.
I have something like this :
PLEASE TAKE ACTION FOR LINE LABEL

But i want the result to be like this:
PLEASE TAKE ACTION FOR LINE Z3, Z5, Z8

I try to use loop but still cant get the result that I want. Here is my loop:

        If ds.Tables(0).Rows.Count <> 0 Then

            For i As Integer = 0 To dt.Rows.Count - 1
                line += dt.Rows(i)("LINE").ToString()
                lblLine.Text = line

            Next

        End If

Can someone help me please..

OK I got it solved by this code:

 If ds.Tables(0).Rows.Count <> 0 Then
            line = Nothing

            For i As Integer = 0 To dt.Rows.Count - 1
                line = line & "   " & dt.Rows(i)("LINE").ToString()

            Next

            lblLine.Text = line

        End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.