Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2008

Tip: Looking for answers? Try searching our database.

Oracle connectivity Issue with .Net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Saquib - 31 Jan 2008 11:22 GMT
Hi All,

I have built a simple .Net console application. In which i am trying
to connect to the oracle database by using Oracle data provider
for .Net from ORACLE site and it works fine on my machine. I have
installed the same on my main server but when i run this application
from Our main server i am getting an exception. The exception is as
follows.

'Oracle.DataAccess.Client.OracleException at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
rrCode, OracleConnection conn, IntPtr opsErrCt
x, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
  at Oracle.DataAccess.Client.OracleException.HandleError(Int32
errCode, Oracle
Connection conn, IntPtr opsErrCtx, Object src)
  at Oracle.DataAccess.Client.OracleConnection.Open()
  at TestODACWithWindows2000.Program.Main(String[] args)'

I am not able to trace out the exact cause why it is failing from that
server. While the oracle server is pingable from that server.

My application is as follows

using System;
using System.Collections.Generic;
using System.Text;
using Oracle.DataAccess.Client;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;

namespace TestODACWithWindows2000
{
   class Program
   {
       static void Main(string[] args)
       {
           Console.WriteLine("Opening........");
           string ConnectionString = "Data
Source=(DESCRIPTION="
                                            +
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Host)(PORT=1521)))"
                                                +
"(CONNECT_DATA=(SERVER=DEDICATED)(SID = SID)));"
                                           + "User
Id=username;Password=password;";

           OracleConnection ora = new
OracleConnection(ConnectionString);
           try
           {

               ora.Open();

           }
           catch (Exception ee)
           {
               Console.WriteLine("{0} Exception caught.", ee);
               Console.ReadLine();
           }
       }
   }
}

Please help me out.. Its urgent.
Michael Nemtsev [MVP] - 31 Jan 2008 11:27 GMT
Hello Saquib,

Did u install oracle client to that PC where you site locates?

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

S> Hi All,
S>
S> I have built a simple .Net console application. In which i am trying
S> to connect to the oracle database by using Oracle data provider
S> for .Net from ORACLE site and it works fine on my machine. I have
S> installed the same on my main server but when i run this application
S> from Our main server i am getting an exception. The exception is as
S> follows.
S> 'Oracle.DataAccess.Client.OracleException at
S> Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
S> rrCode, OracleConnection conn, IntPtr opsErrCt
S> x, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
S> at Oracle.DataAccess.Client.OracleException.HandleError(Int32
S> errCode, Oracle
S> Connection conn, IntPtr opsErrCtx, Object src)
S> at Oracle.DataAccess.Client.OracleConnection.Open()
S> at TestODACWithWindows2000.Program.Main(String[] args)'
S> I am not able to trace out the exact cause why it is failing from
S> that server. While the oracle server is pingable from that server.
S>
S> My application is as follows
S>
S> using System;
S> using System.Collections.Generic;
S> using System.Text;
S> using Oracle.DataAccess.Client;
S> using System.Data.SqlClient;
S> using System.Xml;
S> using System.Data;
S> using System.Xml.XPath;
S> using System.Xml.Xsl;
S> using System.IO;
S> namespace TestODACWithWindows2000
S> {
S> class Program
S> {
S> static void Main(string[] args)
S> {
S> Console.WriteLine("Opening........");
S> string ConnectionString = "Data
S> Source=(DESCRIPTION="
S> +
S> "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Host)(PORT=1521)))"
S> +
S> "(CONNECT_DATA=(SERVER=DEDICATED)(SID = SID)));"
S> + "User
S> Id=username;Password=password;";
S> OracleConnection ora = new
S> OracleConnection(ConnectionString);
S> try
S> {
S> ora.Open();
S>
S> }
S> catch (Exception ee)
S> {
S> Console.WriteLine("{0} Exception caught.", ee);
S> Console.ReadLine();
S> }
S> }
S> }
S> }
S> Please help me out.. Its urgent.
S>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.