Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Problem Loading Dataset with Excel File
[b][red]This message was edited by chip050555 at 2005-10-18 13:37:53[/red][/b][hr]
I am trying to read data from an Excel spreadsheet into a dataset so that I can get the sum of a column. I keep getting a "Value cannot be Null. Parameter Name: Dataset." What am I doing wrong?
Option Strict On
Public Class Form1
" Windows Form Designer generated code "
Private MyXLEmeraldDS As New DataSet
Private MyXLEmeraldConn As New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0; & data source = \SrvSMTT22210023EmeraldX_CMP.xls; & Extended Properties = Excel 8.0")
Private MyXLSQL As String = "SELECT * FROM [Component2$]" 'R5C13:R54C13
Private MyXLEmeraldComm As New OleDbDataAdapter(MyXLSQL, MyXLEmeraldConn)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Catch x As Exception
Any Suggestions would be nice.
0 · ·