Can anyone tell me why I am getting this error? Below is an example of my
code, along with the error message a stack trace.



Error and Stack Trace
Object reference not set to an instance of an object.
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 54: ds = New DataSet()Line 55: da = New OleDbDataAdapter("SELECT
* FROM TBLPEOPLE", cn)Line 56: da.Fill(ds)Line 57: Line 58:
' retstr = System.Environment.StackTrace.ToString

Source File: C:\Inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb Line:
56

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
System.Data.Common.IRowset.GetData(IntPtr hRow, IntPtr hAccessor, IntPtr
pData) +0 System.Data.OleDb.OleDbDataReader.GetRowDataFromHandle() System.Data.OleDb.OleDbDataReader.FindValueBinding(Int32
index) System.Data.OleDb.OleDbDataReader.PeekValueBinding(Int32 index)
System.Data.OleDb.OleDbDataReader.GetValues(Object[] values) System.Data.Common.SchemaMapping.LoadDataRow(Boolean
clearDataValues, Boolean acceptChanges) System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping
mapping) System.Data.Common.DbDataAdapter.FillFromReader(Object data, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn
parentChapterColumn, Object parentChapterValue) System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32
maxRecords) System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) WebApplication1.WebForm1.Page_Load(Object
sender, EventArgs e) in C:\Inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb:56
System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()



Code Example
Dim cn As New OleDbConnection()
Dim ds As DataSet
Dim da As OleDbDataAdapter
Dim cm As OleDbCommand
Dim rowcount As Integer
Dim retstr As String

cn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=ORA9ITST;User
ID=dbo;Password=master;Database=ORA9ITST"
cn.Open()

cm = New OleDbCommand("", cn)
cm.CommandText = "ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY'"
cm.CommandType = CommandType.Text
rowcount = cm.ExecuteNonQuery()
retstr = CStr(rowcount)

'Fill Dataset
ds = New DataSet()
da = New OleDbDataAdapter("SELECT * FROM TBLPEOPLE", cn)
da.Fill(ds)

Thanks,