Seperate categories from tablle into seperate gridview rows

What I have is a many to many table tha has category and the datafields they assigned to the categories. What I am trying to do is load them into a combined gridview row from the datatable. Currently the db looks as so.

HI,
I would have to rewrite the sql statment each time someone added a new category to the table, the table is able in my original post it has the intCatID and strFieldName. Plus then I would have to soemhow combine them all together into one datatable. I am just trying to pick one distinct category and then combine all the fields that go with that category into one field for the gridview on the screen. I have many categories in ther with the datafields. There has got to be soem way to change the following to rotate through the table and add the intcatId and the category and then roll through and all all the datafields to one columns and then switch to the next category and do the same.

>>would have to rewrite the sql statment each time someone added a new category to the table
no you won't, cause you can query the table schema to get all the fields (columns) and then combine them into a single string, everything in a single sql.
in your current approach, you have to change and compile your code on each new data field.

but for now lets stick to your code, so lets start over.
please post all the fields of either Drat_Category table or drat_regRelation table that you wish to combine.

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Hi,
Drat-RegRelation is the combined database of drat_Category and the fieldnames of drat_registration.

what I am trying to do is give them the ability to pick a category and the fieldnames that they want to save agianst in drat_Registation dynamically and save into a sepeate db drat_Regrelation that I can then pull onto a aspx page that they can tehn save agianst that db without the hassle of create 10 different pages for every category for fields, they can pick which ones they want, save to relation table. This stpe is creating the realtion and then showing back into a grid that they can then edit later on if they want o add fields. hence shwoing the grid like this.

This is my latest I get no errors but also nothing show for my category or my fieldnames
Dim Id As Integer
Dim ctId As DataColumn = dt.Columns.Add("intCategoryId")
Dim Category As DataColumn = dt.Columns.Add("Category")
Dim Fields As DataColumn = dt.Columns.Add("DataFields")

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Problem
Hi all,
While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.
If your ASP.NET page …

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this?
(CODE)
In .NET 3.5, this is possible…

Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…