PC Review


Reply
Thread Tools Rate Thread

Axspreadsheet datasource

 
 
JackD
Guest
Posts: n/a
 
      3rd Mar 2010
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using AxSpreadsheet Eran.Yasso@gmail.com Microsoft C# .NET 0 19th Mar 2007 11:35 AM
Using axSpreadsheet =?Utf-8?B?S2F1c3Rhdg==?= Microsoft Excel Programming 1 10th Oct 2006 10:04 PM
Using axSpreadsheet =?Utf-8?B?S2F1c3Rhdg==?= Microsoft Dot NET Framework Forms 0 10th Oct 2006 05:45 PM
Using axSpreadsheet =?Utf-8?B?S2F1c3Rhdg==?= Microsoft Excel Worksheet Functions 0 10th Oct 2006 05:44 PM
AxSpreadsheet Help !!! Daniel Junges Microsoft Excel Programming 2 7th Oct 2005 12:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 AM.