0

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..

1
Contributor
1
Reply
6
Views
4 Years
Discussion Span
Last Post by lulu79
0

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
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.