I have a simple webform with a few form fields and a button. When the user clicks the button(Protected Sub btnGo_Click), data is loaded from MSSQL into a dataset and placed into the form fields.
Now, I have another button(Protected Sub btnXml_Click) that, when clicked, is supposed to write all the data that's now in the dataset to an XML file.
However, I am getting this error:
Object reference not set to an instance of an object.
My concern is, that since the data is being loaded within one Protected Sub, the other button in the other Protected Sub can't see it. So to Protected Sub btnXml_Click, the dataset looks empty.
Could that be the cause of my error?
My code looks like this:
1 Imports System.Data.OleDb
2 Imports System.Xml
3 Go to the complete details ...