I made c# asp.net web form application with visual studio 2008 with oracle 10g database using Oracle.DataAccess. When I start debugging or start withoutdebuggin from visual studio, it workd fine. (visual studio and oracle 10g server and client are installed in my pc). I publish the application and use ftp to upload it into the web server (free shared asp.net hosting site). When I go to the url, the application's first page appeared. but, when I click Select(which select information from DB) button on the application, gives me error. ("Oops! This link appears to be broken.")
If the error tells me what's wrong with apps, then I can try to fix the problem, however, I have no idea what's wrong with apps by "Oops! This link appears to be broken."....

Does anyone tells me how to see the actual error message? or any guess what's wrong with the application?

This is I used in my app.(works fine in visual studio environment...) Should I change the host? port??

string MyDB = "Data Source=(DESCRIPTION="
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Mymydomain.com)(PORT=1521)))"
+ "(CONNECT_DATA=(SERVER= )(SERVICE_NAME=MyDB)));"
+ "User Id=demo;Password=demo;";

OracleConnection conn = new OracleConnection(DB101);
conn.ConnectionString = DB101;

conn.Open();

Regards

Dani AI

Generated

Good move enabling full ASP.NET errors (that lets you see the real exception and inner exception instead of the Chrome “Oops” page). Now that you can read the failure, focus on two common causes when code works locally but fails on a shared host: the Oracle client/driver environment, and network/firewall restrictions. The unmanaged ODP.NET assembly (Oracle.DataAccess) depends on native Oracle client libraries and must match the server-side bitness and installation paths; mismatches or missing native DLLs are a frequent root cause. (See Oracle ODP.NET install/config notes.) (https://docs.oracle.com/database/121/ODPNT/InstallConfig.htm)

If the exception is a .NET assembly load error (e.g., Oracle.DataAccess not found or version/bitness mismatch), consider switching to the managed ODP.NET driver and deploying its single DLL with the app (no Oracle client install required). That is the supported, xcopy-friendly option for shared servers. (Oracle docs and practical guidance on managed vs unmanaged ODP.NET.) (https://docs.oracle.com/database/121/ODPNT/InstallSystemRequirements.htm)

If the exception is a socket/timeout or an ORA networking error, verify the connection descriptor and ask the host whether outbound TCP to the database host:1521 is permitted from your account (many shared plans do not permit arbitrary server-level installs or open outbound ports). You can also try the simpler Easy Connect data-source form (host:port/service) when the host permits it. (Easy Connect / connection-string details.) (https://docs.oracle.com/database/121/ODPNT/featConnecting.htm) (About shared-hosting limits.) (https://www.techradar.com/news/how-shared-hosting-can-kill-your-online-business)

Checklist: collect the full exception + inner exception + stack trace; if it mentions Oracle.DataAccess, try Oracle.ManagedDataAccess.dll in your bin; if it shows ORA- or network errors, contact the host with the exact message and ask if Oracle client/ODP.NET is supported and whether outbound 1521 is allowed. — with error details you can now target the right fix; ’s pointer to show detailed errors was exactly the right first step.

Recommended Answers

All 5 Replies

Addition: I am very new to asp.net.(trying to create web based version of my desktop app). Previously I made C# asp.net app without any database in the same web server and it works fine. It might be my free asp.net application hosting site does not support to connect db. it is free after all.

Unfortunately its challenging to answer you based on the description. You did indicate that it worked locally so at least you know your code works. Does this free provider have any documentation regarding support for data sources including connection info?

Dear JorgeM,
Thank you for your reply. I sent an e-mail asking if they support it or not.
Since I never have experience to publish an asp.net web application connect to db, I have no idea what causing the problem....
If the hosting service supports everything I need to do, then I can see more detailed error message like ORA-error on the screen like I saw them in the visual studio environment?

The error message you will see depends on the type of error and where the error occurs. for example, if if the error is asp.net related and you have your web.config to get detailed error messages you would get more than just the generic error response. In your web.config, you would set it...

<configuration>
   <system.web>
      <customErrors mode="off"/>
   </system.web>
</configuration>

Now, if the error occurs at the web server level, you wouldnt see an error generated by the asp.net engine, it would come from the web server itself.

In addition, your web browser may have friendly errors enabled and therefore you are getting the "Oops! This link appears to be broken." It sounds like you are running Google Chrome? This would be an indication that you really got a 404 Page Not found back from the web server which is an indication that you are using the incorrect URL.

I modified my web config file to <customErrors mode="Off"></customErrors> then it shows me the errors.
This is a lot better than "Oops! This link appears to be broken."
Thank you very much for your help.

Now, time to resolve the problems...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.