I have an array of a template type which I am scanning within a function to find a particular row. I would like to return that row (or all values from the row) from the function but haven’t been able to determine how to declare a variable of that type.
If you want to access a row from a user defined type, you can use the following method:
Dim dt As DataTable=TK.ProjectDB.GetUserTemplate(“teststbl”);
The TK.ProjectDB.GetUserTemplate() method will retrieve a DataTable that contains all the rows and columns from the Template you created. If you wish to display this table, you can assign it to a DataTable type variable and set it as the data source for a DataGrid object.
Regarding declaring a variable of a user defined type, it isnot possible. However, you can create a local class that matches the structure of your template. Then, you can assign each member of your tag to the corresponding variable.
Here’s an example where a class called “Templates” is created, and a variable test1 of type Templates is declared:
Please let us know if this information is helpful to you.