I have a table in the Access DB which is structured this way:
ITEMID
FIELDNAME
FIELDVALUE
The Key is ITEMID,FIELDNAME
I need such a configuration because the items I need to store can have whatever fields the user could like. A simple example of the data contained could be:
ITEMID;FIELDNAME;FIELDVALUE
1;FIELDA;1111
1;FIELDB;2222
2;FIELDA;3333
2;FIELDB;4444
I need to load a datagrid in VB.NET displaying a table like this (according to the above example):
ITEM;FIELDA;FIELDB
1;1111;2222
2;3333;4444
I used to just load the data from Access and then build the grid directly from VB, but the records are becoming too many and this approach is just too slow. I was thinking about creating the table I need directly from a query, and then loading the result in a grid; however, this is something I'm having problems doing. Could anyone help me? Thanks.
Just a couple of notes:
- not every field is necessary present for each ITEM, so I need to handle the possibility of DBNull entries for some fields.
- If it can help, I know which fieldnames I can get before querying the DB
ITEMID
FIELDNAME
FIELDVALUE
The Key is ITEMID,FIELDNAME
I need such a configuration because the items I need to store can have whatever fields the user could like. A simple example of the data contained could be:
ITEMID;FIELDNAME;FIELDVALUE
1;FIELDA;1111
1;FIELDB;2222
2;FIELDA;3333
2;FIELDB;4444
I need to load a datagrid in VB.NET displaying a table like this (according to the above example):
ITEM;FIELDA;FIELDB
1;1111;2222
2;3333;4444
I used to just load the data from Access and then build the grid directly from VB, but the records are becoming too many and this approach is just too slow. I was thinking about creating the table I need directly from a query, and then loading the result in a grid; however, this is something I'm having problems doing. Could anyone help me? Thanks.
Just a couple of notes:
- not every field is necessary present for each ITEM, so I need to handle the possibility of DBNull entries for some fields.
- If it can help, I know which fieldnames I can get before querying the DB