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")Likely, Item("Product_Details") comes as null.You need to check it on null
first.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"psychomad" <bhavish1987@.gmail.com> wrote in message
news:1176355853.044030.321560@.l77g2000hsb.googlegroups.com...
> 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")
>
On Apr 12, 7:30 am, "psychomad" <bhavish1...@.gmail.com> wrote:
> Can some1 please help me?!!!!!!! Please...
> Server Error in '/' Application.
> ----=
--=AD--
> 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 =3D
> oDS.Tables("product").Rows(0).Item("Product_Number")
> Line 23: txtProduct_Type.Text =3D
> oDS.Tables("product").Rows(0).Item("Product_Type")
> Line 24: txtProduct.Text =3D
> oDS.Tables("product").Rows(0).Item("Product")
> Line 25: txtProduct_Details.Text =3D
> 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
.=2E..
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment