2

I am creating a project in VB.NET in which one of the reports require that the name of employees should be displayed as column names and whatever work they have done for a stated period should appear in rows below that particular column.

Now as it is clear, the columns will have to be added at runtime. Am using an ODBC Data source to populate the grid. Also since a loop will have to be done to find out the work done by employees individually, so the number of rows under one column might be less or more than the rows in the next column.

Is there a way to create an empty data table and then update its contents based on columns and not add data based on addition of new rows.

Regards

Ankit
  • 85
  • 2
  • 7

2 Answers2

0

Wouldn't it be better to simply switch the table orientation?

If most of your columns are names or maybe regroupment I dont' know, then you'd have one column for each of the data you could display,

And you'd add each rows with the names and stats dynamically, which is more common.

I'm only suggesting that, because I don't know all your table structure.

Ludovic Migneault
  • 140
  • 1
  • 4
  • 19
0

A table consists of rows and columns: the rows hold the data, the columns define the data.

So you have no other choice than to add at least that many rows as your longest column will need. You could just fill up empty values in the other columns. That should give you the view you need.

MicSim
  • 26,265
  • 16
  • 90
  • 133