G
Guest
Hello,
I get an error saying "object reference not set to an instance of an object"
when running my application on some computers (not all!).
The error is on the last line (da3.fill) in this code:
Dim ds As New DataSet
Private Sub Save_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'...
cn.ConnectionString = myConn '...
Dim da As New SqlDataAdapter("USE Smart2DB SELECT DISTINCT
MeasurementSeries FROM Measurements", cn.ConnectionString)
da.Fill(ds, "Measurements")
'...
ds.Clear()
ds.Tables.Clear()
Dim da2 As New SqlDataAdapter("SELECT MeasurementSeries, SeriesNo FROM
Measurements", cn.ConnectionString)
da2.Fill(ds, "Measurements")
'...
Dim da3 As New SqlDataAdapter(mySelectCommand, myConnectionString)
ds.Clear()
ds.Tables.Clear()
da3.Fill(ds, "Measurements")
'...
End Sub
Any ideas why this only happens on some computers and not all?
And why not on the first dataadapter.fill(dataset) line?
I'm stuck. Googling hasn't helped me...
I would really appreciate help with this.
Please tell me if you need more information/code.
TIA and best regards
/DAST
I get an error saying "object reference not set to an instance of an object"
when running my application on some computers (not all!).
The error is on the last line (da3.fill) in this code:
Dim ds As New DataSet
Private Sub Save_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'...
cn.ConnectionString = myConn '...
Dim da As New SqlDataAdapter("USE Smart2DB SELECT DISTINCT
MeasurementSeries FROM Measurements", cn.ConnectionString)
da.Fill(ds, "Measurements")
'...
ds.Clear()
ds.Tables.Clear()
Dim da2 As New SqlDataAdapter("SELECT MeasurementSeries, SeriesNo FROM
Measurements", cn.ConnectionString)
da2.Fill(ds, "Measurements")
'...
Dim da3 As New SqlDataAdapter(mySelectCommand, myConnectionString)
ds.Clear()
ds.Tables.Clear()
da3.Fill(ds, "Measurements")
'...
End Sub
Any ideas why this only happens on some computers and not all?
And why not on the first dataadapter.fill(dataset) line?
I'm stuck. Googling hasn't helped me...
I would really appreciate help with this.
Please tell me if you need more information/code.
TIA and best regards
/DAST