dataset fill with OledB from a web form?


New member
Aug 12, 2005
Programming Experience
Just starting out with VB.Net and am setting up a very simple test to try and overcome a problem I'm having with code to FILL a dataset from a web form using OleDbDataAdapter to access a source MS ACCESS database.

I would be grateful for any help with the problem. Is there anything wrong with the code listed in the error message?

The Task list in Visual Studio shows no errors prior to debug but when I debug the above error occurs. I think the object reference is set to an instance (mydataset1) of an object (mydataset).


Server Error in '/TestApp' Application.
Object reference not set to an instance of an object.

[font=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 117: If Not IsPostBack ThenLine 118: Dim myDataSet1 As New DataSet1Line 119: Me.OleDbDataAdapter1.Fill(myDataSet1)Line 120: End IfLine 121: End Sub
Source File: c:\inetpub\wwwroot\TestApp\WebForm1.aspx.vb Line: 119

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] TestApp.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\TestApp\WebForm1.aspx.vb:119 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 [/font]
Top Bottom