Search code examples
vb.netfarpoint-spread

Best way to get data from a DataReader into a Farpoint Spreadsheet?


I need to move data from a datareader into a Farpoint Spreadsheet component in a Windows form. The DataSource of an fps sheet can't be set to a datareader. I don't want to change my app to use ADO just for this purpose.

Right now I'm looping through the query data and pushing it into the sheet cell-by-cell. That's ugly, and I am sure performance will suffer for large datasets (though I haven't tried it yet).

Does anyone here know a better way to get a datareader into one of these components? I'm using VB.NET, but a C# example would be fine.


Solution

  • I'm not familiar with the product, but you can try loading the reader into a DataTable and binding that if it's supported.

    Dim dt as Datatable
    dt.load(reader)