Object reference not set to an instance of an object

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

Guest

i'm using asp.net 1.1 & ms access.
the ms-access database is placed in a separate folder with permissions set as belo
Administrator : full contro
ASPNET : full contro
user1 : full contro
& set to open in shared mode, no record locking
the file is also shared for user1 to insert/update the database through a desktop Access Application

I get the data & display it in the aspx page (no updating/inserting is done through the asp.net appln.) as below
-get the records from Table1 & fill a DrpDown Box with th dat
-based on the selection of the above dropdown box, I get a set of related records from Table2 & fill a datagrid with i
the page works fine most of the times, but some times i get an error message "Object reference not set to an instance of an object." when the asp.net appln. tries to read data from the database & fill the dropdown box, though there is data in the table

Is it due to exclusive locking by some form in the access appln or some problem with permissions or what else

need urgent help pls

thanx
 
typically, this exception is thrown when a method or property is called on a
null object. i suspect it is coming from the data returned in the dataset.
are you explicitly testing before calling methods on the object? Consider:
DataSet ds = "some query was fired to return results"
test before you bind
if(ds != null && ds.Tables[0].Rows.Count > 0)
//bind
else
//indicate no data condition

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
D Pahadsing said:
i'm using asp.net 1.1 & ms access.
the ms-access database is placed in a separate folder with permissions set as below
Administrator : full control
ASPNET : full control
user1 : full control
& set to open in shared mode, no record locking.
the file is also shared for user1 to insert/update the database through a desktop Access Application.

I get the data & display it in the aspx page (no updating/inserting is
done through the asp.net appln.) as below:
-get the records from Table1 & fill a DrpDown Box with th data
-based on the selection of the above dropdown box, I get a set of related
records from Table2 & fill a datagrid with it
the page works fine most of the times, but some times i get an error
message "Object reference not set to an instance of an object." when the
asp.net appln. tries to read data from the database & fill the dropdown box,
though there is data in the table.
Is it due to exclusive locking by some form in the access appln or some
problem with permissions or what else?
 
Back
Top