Last post May 21, 2016 08:08 AM by Chris Zhao
May 11, 2016 06:38 PM|Rakib1|LINK
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.
May 12, 2016 12:29 AM|Nataraj Gandhi Arunachalam|LINK
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.
May 12, 2016 12:34 AM|oned_gk|LINK
Ensure you have set connection for the SelectCommand, something like cmd.Connection =
conn or new sqlcommand(query, conn)
May 12, 2016 06:59 AM|Chris Zhao|LINK
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.
May 12, 2016 07:08 PM|Rakib1|LINK
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?
May 21, 2016 08:08 AM|Chris Zhao|LINK
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.