Asked by:
Values are not populating into drop down after publishing to iis but during the debug into visual studio its work

Question
-
User-1797368610 posted
Hi,
Asp.net application not able to populate values from Oracle DB. Connection string has defined into Web.config. while i run the code from visual studio itself, its works fine, getting values from oracle and populating values into drop down list. once i publish the solution into file system and attached the physical path to iis site not working means page is displaying but value is not populating. FYI, i have added the that particular page to display into web.config file to the system.webServer section. any suggestion or help will be greatly appreciated. getting below error.
Wednesday, May 11, 2016 6:38 PM
All replies
-
User-286291038 posted
Hi Rakib1,
From the error, it seems related to the connection settings of your select command.
Please check your file system that your IIS site points to and verify the config files to ensure your connection strings are defined correctly. Maybe during config transformation while you published your site, it has gotten changed in some manner.
Thursday, May 12, 2016 12:29 AM -
User-1716253493 posted
Ensure you have set connection for the SelectCommand, something like cmd.Connection = conn or new sqlcommand(query, conn)
Thursday, May 12, 2016 12:34 AM -
User-2057865890 posted
Hi Rakib1,
The following are possibilities:
Probably your connection string accessing a local database file which you don't have on your machine.
You forgot to set connection for your command object.Best Regards,
Chris
Thursday, May 12, 2016 6:59 AM -
User-1797368610 posted
Hey All,
Thanks for your reply. I have checked the web.config after publish nothing has changed. As i said if i debug the solution from VS itself, working fine but when same solution deploy into iis not working. First saying "Object reference not set to an instance of an object" and then to access any page need to manually insert that page (home.aspx) into address bar but drop-down list not getting value from oracle. now question is if something wrong with oracle connection why i am able to get the values during debugging?
Thanks
Thursday, May 12, 2016 7:08 PM -
User-2057865890 posted
Hi Rakib1,
saying "Object reference not set to an instance of an object"The error indicates an object is null. There is some object which is NULL and you will be trying to read some property value of that object. This is the reason for the Object reference not set to an instance of an object. Please post your code, also mark the exact line where you are getting this error.
Best Regards,
Chris
Saturday, May 21, 2016 8:08 AM