Value cannot be null

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi,

I'm new to .NET and I'm trying to run through the tutorial
"Creating a Web Application Using VB"

As I follow the directions, It seems to work just fine.

I can preview the data from the SQLDataAdapter but when I
try to view the data in the browser I get the error:


Value cannot be null. Parameter name: dataSet
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.ArgumentNullException: Value
cannot be null. Parameter name: dataSet

Source Error:

Line 2: Inherits System.ComponentModel.Component
Line 3: Public Sub FillDataSet(ByVal dSet As
myDataSet)
Line 4: SqlDataAdapter1.Fill(dSet)
Line 5: End Sub
Line 6: #Region " Component Designer generated code "

Any help would be appreciated. thx.

Paul
801.366.0224
(e-mail address removed)
 
Exception Details: System.ArgumentNullException: Value
cannot be null. Parameter name: dataSet

Source Error:

Line 2: Inherits System.ComponentModel.Component
Line 3: Public Sub FillDataSet(ByVal dSet As
myDataSet)
Line 4: SqlDataAdapter1.Fill(dSet)
Line 5: End Sub
Line 6: #Region " Component Designer generated code "

The error message means that you have not instantiated the dataset object
you are trying to fill

Dim dSet as new Dataset.

Public Sub FillDataSet(ByVal dSet)
SqlDataAdapter1.Fill(dSet)
End Sub
 
Nothing in this code Instantiates a dataset. If the calling code passed in
an Instantiated dataset, it would be ok. what does the caller look like?
before you pass in the dataset do you create a new Datasst

Dim myDS as New DataSet?
 
Back
Top