I want to make a generic tool that formats a query into a table. (This may be something I can do with a DataGrid, but I can't see how.)
I am going to build this control that takes 2 things, the query/Sql command, and the number of columns.
Let's say I have a query that returns 3 fields, and I want that table to go into 2 columns, like this:
Field1 Field2 Field3 Field1 Field2 Field3
Or, 1 field name and 3 colums:
FieldX FieldX FieldX
Basically, I want to do this regardless of how many fields or what their names are.
In ASP classic, I could do something like this:
I got most of the principles set, but I want to know how I could do something like that For Each statement.
If you can show me how to do that in DataGrids that would be even better. (If it is real simple, then forgive me, I am a newbie to .Net.)
I am going to build this control that takes 2 things, the query/Sql command, and the number of columns.
Let's say I have a query that returns 3 fields, and I want that table to go into 2 columns, like this:
Field1 Field2 Field3 Field1 Field2 Field3
Or, 1 field name and 3 colums:
FieldX FieldX FieldX
Basically, I want to do this regardless of how many fields or what their names are.
In ASP classic, I could do something like this:
Code:
For each fldF in recSet.Fields
Response.Write "<td>" & fldF.Value & "</td>"
Next
I got most of the principles set, but I want to know how I could do something like that For Each statement.
If you can show me how to do that in DataGrids that would be even better. (If it is real simple, then forgive me, I am a newbie to .Net.)