Object reference not set to an instance of an object.

P

psychomad

Can some1 please help me???!!!!!!! Please....



Server Error in '/' Application.
--------------------------------------------------------------------------------

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 21: oDA.Fill(oDS, "product")
Line 22: 'lblProduct_Number.text =
oDS.Tables("product").Rows(0).Item("Product_Number")
Line 23: txtProduct_Type.Text =
oDS.Tables("product").Rows(0).Item("Product_Type")
Line 24: txtProduct.Text =
oDS.Tables("product").Rows(0).Item("Product")
Line 25: txtProduct_Details.Text =
oDS.Tables("product").Rows(0).Item("Product_Details")
 
G

Guest

Can some1 please help me???!!!!!!! Please....

Server Error in '/' Application.
---------------------------------------------------------------------------­-----

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 21: oDA.Fill(oDS, "product")
Line 22: 'lblProduct_Number.text =
oDS.Tables("product").Rows(0).Item("Product_Number")
Line 23: txtProduct_Type.Text =
oDS.Tables("product").Rows(0).Item("Product_Type")
Line 24: txtProduct.Text =
oDS.Tables("product").Rows(0).Item("Product")
Line 25: txtProduct_Details.Text =
oDS.Tables("product").Rows(0).Item("Product_Details")

When product has no rows you will get an error

Try to check:

oDA.Fill(oDS, "product")
if oDS.Tables("product").Rows.Count > 0 then

.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top