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

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

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

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

This article has been dead for over six months. Start a new discussion instead.