getting System.NullReferenceException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

H

I want to merge two dataset
When select command of data adapter(which is linked to dataset1) doesn’t return any resul
dataset1.Merger(dataset2, true) statement throws “System.NullReferenceException†exceptio

How can I make sure dataset1 is not null

Thanks for help in advance
 
Make sure that you instantiate both of them.. = new DataSet

and then you can check with using Is Nothing (I take it you are in VB.NET?)

If (Not DataSet1 Is Nothing) Then 'May want to verify dataset2 as well
dataSet1.Merge(dataSEt2, true)

End If
SM said:
Hi

I want to merge two dataset.
When select command of data adapter(which is linked to dataset1) doesn't return any result
dataset1.Merger(dataset2, true) statement throws
"System.NullReferenceException" exception
 
Back
Top