Posts
1150
Comments
891
Trackbacks
1
.NET: Runtime DataBinding for the Microsoft Spreadsheet Control for Windows Forms

I'm using version 11, but I assume the syntax is similar for previous versions.

if oExcel is your Spreadsheet Control, then you can databind by setting the ConnectionString and CommandText of the ActiveSheet, like this:

oExcel.ActiveSheet.ConnectionString = ConnectionString;
oExcel.ActiveSheet.CommandText = "myStoredProcName";

If you aren't sure what to use as a ConnectionString, right-click on the control at design-time, choose commands and options, and run through the wizard to choose your data source (you can then delete the settings if you don't want there to be any default load).

posted on Thursday, August 11, 2005 12:51 PM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 2 and 5 and type the answer here: