Claude-GTA3
New Member
I have data that looks like this:\[code\]bill col 1 goodbill col 2 okbill col 3 triffbill col 4 A1bob col 1 poorbob col 2 excellentbob col 3 okbob col 4 B+bert col 1 bert col 2 no infobert col 3 passbert col 4 C-\[/code\]and I want a gridview (?) with databinding that's laid out like this:\[code\]Name col 1 col 2 col 3 col 4Bill good ok triff A1Bob poor excellent ok B+bert no info pass C-\[/code\]So I can edit/insert data as needed.The killer is that the number of columns can vary, eg I've 4 in the first example above, but it can be any number between 10 - 15. Hence on a second extract the data might look like this:\[code\]brenda col 1 okbrenda col 2 okbrenda col 3 excellentboris col 1 poorboris col 2 okboris col 3 okbaz col 1 greatbaz col 2 no infobaz col 3 ok\[/code\]Giving a table like this:\[code\]Name col 1 col 2 col 3brenda ok ok excellentboris poor ok okbaz great no info ok\[/code\]I've explored sql pivot but I don't want the data summarised in any way, it's just a single field of text per record. I've tried to build a DataTable piecemeal from multiple sql-extracts-into-datatables-then-loop (that works, kinda, but I can't figure out how to bind the data after)Any ideas? I've caned this for four days and I'm stumped. The offer of the wifey coming round to cook your Sunday dinner is still on...