Good day!

I have this datasets format in sql server!

AccountID   AccountName    1/30/2013  2/30/2013  3/30/2013
   4        Credit Cards    20,000      30,000     12,000
   5        Loans Payable   5,000       6,000      5,000

How can I load all this data to listview? The colums are dynamic. It could be 6, 7, 8, or 12, or higher. The listview should display all the columns on the dataset dynamically. The column name of the dataset should be the column header name in each column in the listview.

Thank you for helping!

hey nice quote..appreaciable

I have this solution and it seems its working!

dim rsheaders as new adodb.recordset
dim counter as integer
dim rsfields as field

for each rsfields in rsheaders
   msgbox rsfields.name   'get the header name
next

'loading dynamic data. This can be applied to any datagrid. Just modify the code
while not rsheaders.eof
  for counter=0 to rpt.columns.count - 1 'the columncount of the datagrid or any grid you used
      fielddata.value=rsheaders.fields(counter).value   'getting data, wahtever format applicable to your datagrid
  next
  rsheaders.movenext
wend

Thank you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.