?
Solved

Display Array content into label

Posted on 2006-11-30
6
Medium Priority
?
499 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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