0

What I need, is one three-dimensional array that holds:

1. Column name
2. MaxLength
3. DataType

My code is close, I just can't remember the syntax for adding data to the array.

Please help,
Sheryl

'get the column information
                    Dim c As Integer = 0
                    Dim x As Integer = 0
                    Dim y As Integer = 0
                    Dim iCount As Integer = columnCount - 1
                    Dim aFields(iCount, iCount, iCount) As String
                    For Each dc As DataColumn In objDS.Tables(strTableName).Columns
                        aFields(c, x, y) = dc.ColumnName
                        aFields(c, x, y) = dc.MaxLength.ToString
                        aFields(c, x, y) = dc.DataType.ToString
                        frmDesigner.ListBox1.Items.Add(aFields(c, x, y))
                        c = c + 1
                        x = x + 1
                        y = y + 1
                    Next
2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by iamthwee
0

As long as I can reference each item separately, that's what I need. Thanks.

0

I think I figured it out. The following code puts each of the three items into the array. This may not be the best way to do it, so I'm open to suggestions.

~ Sheryl

Dim aFields(iCount, 2) As String
                    For Each dc As DataColumn In objDS.Tables(strTableName).Columns
                        aFields(c, 0) = dc.ColumnName
                        afields(c, 1) = dc.MaxLength.ToString
                        aFields(c, 2) = dc.DataType.ToString
                        c = c + 1
                  Next
0

If it works it works, but I'd recommend reading up on classes as they form an integral part of code design.

This topic has been dead for over six months. 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.