LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Axspreadsheet datasource

Hi all,
I am using OWC11 (AxSpreadsheet) control in my vb.net application. In that
i need to display data from Mysql DB. This is my sample code to bind data to
spreadsheet.

AxSpreadsheet2.Worksheets(1).Cells.Clear()
AxSpreadsheet2.Worksheets(1).Name = "Batches"
AxSpreadsheet2.Worksheets(1).StandardWidth = 15

cmd.CommandText = "SELECT * FROM `TableName`"
cmd.Connection = connect
If connect.State = ConnectionState.Closed Then connect.Open()
Dim da As New MySqlClient.MySqlDataAdapter
Dim ds As New DataSet
da = New MySqlClient.MySqlDataAdapter(cmd)
da.Fill(ds)

ProgressBar1.Value = 0
ProgressBar1.Maximum = ds.Tables(0).Rows.Count
k = 1

For ro As Integer = 0 To ds.Tables(0).Rows.Count - 1
k += 1
For cl As Integer = 0 To ds.Tables(0).Columns.Count - 1
AxSpreadsheet2.Worksheets(1).Cells(k, cl + 1) =
ds.Tables(0).Rows(ro).Item(cl).ToString
Next
ProgressBar1.Value += 1
Next

But it was very slow. It is possible to use Axspreadsheet.Datasource method
to bind the dataset values.
Pls guide me.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using axSpreadsheet Kaustav Excel Programming 1 October 10th 06 10:04 PM
Using axSpreadsheet Kaustav Excel Worksheet Functions 0 October 10th 06 05:44 PM
Adding PivotTable to AxSpreadsheet Maggie[_7_] Excel Programming 0 February 24th 06 08:50 PM
AxSpreadsheet Help !!! Daniel Junges Excel Programming 2 October 7th 05 12:22 PM
Loading AxSpreadsheet from a .NET resource Paul Hasell Excel Programming 4 September 20th 05 07:26 AM


All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"