OK, we have a collection defined like this:
And a structure defined like this:
A Variable named stFields is created like this:
And the Collection's items are added like this:
This is for a Stored Procedure code generator. We use the above code to
get the columns from a table using the sp_columns system stored procedure
on SQL 2K5 and loop through the result set and build a list of columns and
their properties from the Table.
We then use this collection to build the stored procedure code.
What I want to do is take this collection and show it in a grid with two extra
columns containing checkboxes to select which columns the user wants to
include as parameters or if the column is a datetime type, a checkbox to
allow them to allow a range to be created.
Then I want to loop through the grid rows that have either checkbox
selected and build another collection of only those columns so I can build the
parameter list and do other things with the generated stored procedure code.
How would I do that in VB.Net??
VB.NET:
Private collFields As Collection
And a structure defined like this:
VB.NET:
Private Structure Fields
Dim FieldName As String
Dim FieldType As String
Dim Precision As Integer
Dim Scale As Integer
End Structure
A Variable named stFields is created like this:
VB.NET:
Dim stFields As New Fields
And the Collection's items are added like this:
VB.NET:
collAllFields.Add(stFields, stFields.FieldName)
This is for a Stored Procedure code generator. We use the above code to
get the columns from a table using the sp_columns system stored procedure
on SQL 2K5 and loop through the result set and build a list of columns and
their properties from the Table.
We then use this collection to build the stored procedure code.
What I want to do is take this collection and show it in a grid with two extra
columns containing checkboxes to select which columns the user wants to
include as parameters or if the column is a datetime type, a checkbox to
allow them to allow a range to be created.
Then I want to loop through the grid rows that have either checkbox
selected and build another collection of only those columns so I can build the
parameter list and do other things with the generated stored procedure code.
How would I do that in VB.Net??