Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Display Array content into label

Posted on 2006-11-30
6
Medium Priority
?
506 Views
Last Modified: 2008-02-01
Using VB.NET (.NET 1.1) and ASP.NET, I am trying to display the content of a 2 Dimentional Array into a label on a web form, but I am getting this error:

Value of type 2-dimensional array of Integer cannot be converted to String
0
Comment
Question by:yaney00074
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 18047177
What code are you using ? something like this ?

dim arr(5,5) as string

Label1.Text = arr(1,1).tostring
0
 

Author Comment

by:yaney00074
ID: 18047287
I have an object that has a property called GroupID with is a 2 dimensional array

    Public Property GroupID() As Integer(,)
        Get
            Return Me.mint_groupID
        End Get
        Set(ByVal Value As Integer(,))
            Me.mint_groupID = Value
        End Set
    End Property

objEmployee.GroupID  = GetEmployeeGroupAnRole() As Integer(,)

That fucntion returns a value pair collection of (GroupID, RoleID) the user's belong to

So practically I am getting somethin like this

(0,0) = 222
(0,1) = 3
(1,0) = 232
(1,1) = 1
(,)
(,)
'
'
'
etc...

Let me know if you need further detail
0
 

Author Comment

by:yaney00074
ID: 18047390
I need to know how to loop into this array to display all the content

(0,0) = 222
(0,1) = 3
(1,0) = 232
(1,1) = 1
(,)
(,)
'
'
'
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 18047446
if you are not doing arithemetic on the 'numbers', then you would be better off to treat them as strings

    Dim mint_groupID() as String(,)

    Public Property GroupID() As String(,)
        Get
            Return Me.mint_groupID
        End Get
        Set(ByVal Value As String(,))
            Me.mint_groupID = Value
        End Set
    End Property

objEmployee.GroupID  = GetEmployeeGroupAnRole() As String(,)

AW
0
 

Author Comment

by:yaney00074
ID: 18047736
What I need is this loop to work using a 2 dimensional array

           For i = 0 To UBound(cUser.GroupID, 1) - 1
                For j = 0 To UBound(cUser.GroupID, 1) - 1
                    Me.lblGroup.Text = "(" & cUser.GroupID(i, 0).ToString & ", " & cUser.GroupID(0, j) & ")" & "<br/>"
                Next
            Next

Question:
How do i loop to display the content of the array?
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 1500 total points
ID: 18049817
         For i = 0 To UBound(cUser.GroupID, 1) - 1
                For j = 0 To UBound(cUser.GroupID, 2) - 1
                    Me.lblGroup.Text = Me.lblGroup.Text  & "(" & cUser.GroupID(i, 0).ToString & ", " & cUser.GroupID(0, j) & ")" & "<br/>"
                Next
            Next

AW
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question