Object reference not set to an instance of an object.
-
Hi I am developing an webpage.In my webpage there is a textbox.According to the textbox value,some details come on a button click.In button click event I've initialized OracleCommand object.My code is working for two times.But third time when I press the button,an error occurs saying object reference not set to an instance of an object. I have done such codings thousands of time.But this time I am clueless why this is happening.Can any one help me out?
ARINDAM
-
Hi I am developing an webpage.In my webpage there is a textbox.According to the textbox value,some details come on a button click.In button click event I've initialized OracleCommand object.My code is working for two times.But third time when I press the button,an error occurs saying object reference not set to an instance of an object. I have done such codings thousands of time.But this time I am clueless why this is happening.Can any one help me out?
ARINDAM
-
Are you closing your OracleCommand. Try putting in a break point so you find exactualy one which line your code is breaking.
I have put break point.It is showing the error in string variablename=command.ExecuteScalar().Tostring(). While OracleCommand command=New OracleCommand() line is executing properly before the line at which error occurs. Mysteriously for first two button click it works properly,but at third attempt it gives the error.
ARINDAM
-
I have put break point.It is showing the error in string variablename=command.ExecuteScalar().Tostring(). While OracleCommand command=New OracleCommand() line is executing properly before the line at which error occurs. Mysteriously for first two button click it works properly,but at third attempt it gives the error.
ARINDAM
can u plz mention that line where error occurs...
Maniiiiiiiiiiiiiii
-
I have put break point.It is showing the error in string variablename=command.ExecuteScalar().Tostring(). While OracleCommand command=New OracleCommand() line is executing properly before the line at which error occurs. Mysteriously for first two button click it works properly,but at third attempt it gives the error.
ARINDAM