Connect C# Application to network Oracle 10g install
-
So...I am running Visual Studio 2010 on a new Windows 7 machine. I have a server on the network running Windows 2003 server with Oracle 9i and 10g installed. I am trying to connect to the Oracle 10g database on that server from a new .Net application on the Windows 7 machine. This is the error I keep getting: {"System.Data.OracleClient requires Oracle client software version 8.1.7 or greater."} I Googled the error and I have tried the following suggestions: 1. Changed the administration folder permissions for Read and Execute for Authenticated Users (with reboot). 2. Made changes to the tnsNames.ora file 3. Made changes to the sqlnet.ora file as follows; NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) 4. Changed the listening port to the following different port numbers (1521,1522,8081). This is the connection code with the various config strings that I have tried (Tel1 is the server name):
//Class Variables
string CONNSTR = //"Data Source=//Tel1:1522;User Id=Patrick;Password=Pass;Integrated Security=no";
//"Data Source=Patrick/Pass@//Tel1:1521";
//"Data Source=Patrick/Pass@//Tel1:1522";
//"Server=//Tel1:8081;User ID=Patrick;Password=Pass;";
"Data Source=//Tel1:1522;User Id=Patrick;Password=Pass;Integrated Security=no";public Oracle() { InitializeComponent(); } //Methods private void TestMyOracleConnection() { OracleConnection Conn = new OracleConnection(CONNSTR); try { Conn.Open(); MessageBox.Show("Connection Established", "Success"); } catch (OracleException ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } finally { Conn.Close(); MessageBox.Show("Connection Closed", "Success"); } } private void buttonTestConnection\_Click(object sender, EventArgs e) { TestMyOracleConnection(); }
I am exasperated with this. I never have a connection issue with MS SQL or MySQL...in fact, I made connections from the same .Net program to both of these DB's both over the network and to a remotely hosted server and it works perfectly. Obviously, my knowledge
-
So...I am running Visual Studio 2010 on a new Windows 7 machine. I have a server on the network running Windows 2003 server with Oracle 9i and 10g installed. I am trying to connect to the Oracle 10g database on that server from a new .Net application on the Windows 7 machine. This is the error I keep getting: {"System.Data.OracleClient requires Oracle client software version 8.1.7 or greater."} I Googled the error and I have tried the following suggestions: 1. Changed the administration folder permissions for Read and Execute for Authenticated Users (with reboot). 2. Made changes to the tnsNames.ora file 3. Made changes to the sqlnet.ora file as follows; NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) 4. Changed the listening port to the following different port numbers (1521,1522,8081). This is the connection code with the various config strings that I have tried (Tel1 is the server name):
//Class Variables
string CONNSTR = //"Data Source=//Tel1:1522;User Id=Patrick;Password=Pass;Integrated Security=no";
//"Data Source=Patrick/Pass@//Tel1:1521";
//"Data Source=Patrick/Pass@//Tel1:1522";
//"Server=//Tel1:8081;User ID=Patrick;Password=Pass;";
"Data Source=//Tel1:1522;User Id=Patrick;Password=Pass;Integrated Security=no";public Oracle() { InitializeComponent(); } //Methods private void TestMyOracleConnection() { OracleConnection Conn = new OracleConnection(CONNSTR); try { Conn.Open(); MessageBox.Show("Connection Established", "Success"); } catch (OracleException ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } finally { Conn.Close(); MessageBox.Show("Connection Closed", "Success"); } } private void buttonTestConnection\_Click(object sender, EventArgs e) { TestMyOracleConnection(); }
I am exasperated with this. I never have a connection issue with MS SQL or MySQL...in fact, I made connections from the same .Net program to both of these DB's both over the network and to a remotely hosted server and it works perfectly. Obviously, my knowledge
I beleive your dev machine needs the Oracle client installed (ours did) not just the tsnames file. One of the benefits f going to WCF is that I only need to deal with the server connection to Oracle, not all the clients
Never underestimate the power of human stupidity RAH
-
So...I am running Visual Studio 2010 on a new Windows 7 machine. I have a server on the network running Windows 2003 server with Oracle 9i and 10g installed. I am trying to connect to the Oracle 10g database on that server from a new .Net application on the Windows 7 machine. This is the error I keep getting: {"System.Data.OracleClient requires Oracle client software version 8.1.7 or greater."} I Googled the error and I have tried the following suggestions: 1. Changed the administration folder permissions for Read and Execute for Authenticated Users (with reboot). 2. Made changes to the tnsNames.ora file 3. Made changes to the sqlnet.ora file as follows; NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) 4. Changed the listening port to the following different port numbers (1521,1522,8081). This is the connection code with the various config strings that I have tried (Tel1 is the server name):
//Class Variables
string CONNSTR = //"Data Source=//Tel1:1522;User Id=Patrick;Password=Pass;Integrated Security=no";
//"Data Source=Patrick/Pass@//Tel1:1521";
//"Data Source=Patrick/Pass@//Tel1:1522";
//"Server=//Tel1:8081;User ID=Patrick;Password=Pass;";
"Data Source=//Tel1:1522;User Id=Patrick;Password=Pass;Integrated Security=no";public Oracle() { InitializeComponent(); } //Methods private void TestMyOracleConnection() { OracleConnection Conn = new OracleConnection(CONNSTR); try { Conn.Open(); MessageBox.Show("Connection Established", "Success"); } catch (OracleException ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } finally { Conn.Close(); MessageBox.Show("Connection Closed", "Success"); } } private void buttonTestConnection\_Click(object sender, EventArgs e) { TestMyOracleConnection(); }
I am exasperated with this. I never have a connection issue with MS SQL or MySQL...in fact, I made connections from the same .Net program to both of these DB's both over the network and to a remotely hosted server and it works perfectly. Obviously, my knowledge
Do I understand you correct that you have both oracle 9i and 10g on the same server. While possible, it's a mess to configure, and in IMAO quite pointless. Ok, that was a side track. The error message you get is quite straight forward (for once). Mycroft is probably quite correct, your Oracle client software isn't properly installed.
"When did ignorance become a point of view" - Dilbert
-
Do I understand you correct that you have both oracle 9i and 10g on the same server. While possible, it's a mess to configure, and in IMAO quite pointless. Ok, that was a side track. The error message you get is quite straight forward (for once). Mycroft is probably quite correct, your Oracle client software isn't properly installed.
"When did ignorance become a point of view" - Dilbert
Hello Dilbert Thank you for your input. Re: WCF - comparing the 'cloud' to a real app is, to me, a joke...but if you prefer it, go for it!...:-). Now that that's settled...I am sure you are correct. My original request was somehow cut off before it was finished, so you did not see the end of my original statement. In any event, I installed the client on the developer machine and now I have 2 problems; First, it still does not work. The application stops responding and second; although I took the precaution of running 2 different catch error clauses (see the code), both for Oracle and for general use, the app actually crashes Windows 7 if I do not shut it down immediately following failure. I suppose that I could put the entire 10gEX version on the developer machine and try connecting directly to a local version first just to test the application. I might try that next if I cannot think of another solution. I am new to Oracle, and frankly, I don't like it from an administrative point of view. But it is not my choice to make. If the vendor already has the database in place, it is simply for me to make the application work with it. Thank you again for your time and your reply...I do appreciate it. If you think of anything else, let me know...and have a nice day...Pat. Re: 9i and 10g: a friend of mine that is a DBA for the military and an adjunct professor/instructor in databases at our college set this machine up for me to practice with. It was never intended to be an actual solution but rather a training aid. It also has MS SQL 2005 and MySql on it as well.>>Pat
-
I beleive your dev machine needs the Oracle client installed (ours did) not just the tsnames file. One of the benefits f going to WCF is that I only need to deal with the server connection to Oracle, not all the clients
Never underestimate the power of human stupidity RAH
-
Hello Dilbert Thank you for your input. Re: WCF - comparing the 'cloud' to a real app is, to me, a joke...but if you prefer it, go for it!...:-). Now that that's settled...I am sure you are correct. My original request was somehow cut off before it was finished, so you did not see the end of my original statement. In any event, I installed the client on the developer machine and now I have 2 problems; First, it still does not work. The application stops responding and second; although I took the precaution of running 2 different catch error clauses (see the code), both for Oracle and for general use, the app actually crashes Windows 7 if I do not shut it down immediately following failure. I suppose that I could put the entire 10gEX version on the developer machine and try connecting directly to a local version first just to test the application. I might try that next if I cannot think of another solution. I am new to Oracle, and frankly, I don't like it from an administrative point of view. But it is not my choice to make. If the vendor already has the database in place, it is simply for me to make the application work with it. Thank you again for your time and your reply...I do appreciate it. If you think of anything else, let me know...and have a nice day...Pat. Re: 9i and 10g: a friend of mine that is a DBA for the military and an adjunct professor/instructor in databases at our college set this machine up for me to practice with. It was never intended to be an actual solution but rather a training aid. It also has MS SQL 2005 and MySql on it as well.>>Pat
PDTUM wrote:
DBA for the military and an adjunct professor/instructor
Ok so a military academic set up your server with all the most common databases available and you wonder why it won't talk to you. :laugh: :laugh: :laugh: Seriously, I'm not surprised the poor thing won't cooperate. And yes Oracle is a PITA to manage, especially after coming from SQL Server, it does however chew through the data with gratifying speed.
Never underestimate the power of human stupidity RAH
-
Hello Dilbert Thank you for your input. Re: WCF - comparing the 'cloud' to a real app is, to me, a joke...but if you prefer it, go for it!...:-). Now that that's settled...I am sure you are correct. My original request was somehow cut off before it was finished, so you did not see the end of my original statement. In any event, I installed the client on the developer machine and now I have 2 problems; First, it still does not work. The application stops responding and second; although I took the precaution of running 2 different catch error clauses (see the code), both for Oracle and for general use, the app actually crashes Windows 7 if I do not shut it down immediately following failure. I suppose that I could put the entire 10gEX version on the developer machine and try connecting directly to a local version first just to test the application. I might try that next if I cannot think of another solution. I am new to Oracle, and frankly, I don't like it from an administrative point of view. But it is not my choice to make. If the vendor already has the database in place, it is simply for me to make the application work with it. Thank you again for your time and your reply...I do appreciate it. If you think of anything else, let me know...and have a nice day...Pat. Re: 9i and 10g: a friend of mine that is a DBA for the military and an adjunct professor/instructor in databases at our college set this machine up for me to practice with. It was never intended to be an actual solution but rather a training aid. It also has MS SQL 2005 and MySql on it as well.>>Pat
-
PDTUM wrote:
the app actually crashes Windows 7 if I do not shut it down immediately following failure
The OS actually crashes versus you receiving an OS exception?
Hello js, Thank you for your question....Yes. Since I made the earlier post, I have installed 10g on the local server and everything works perfectly. Although I have gotten great help from the people here, I still have the original issue in this case, so I just uploaded a post to another forum as I am still baffled by this. I will post the new text below. If you have any ideas...I am ALL ears...:-)...Thanks, Pat I have a Windows 7 dev machine used to create .Net applications with VS 2010. I want to connect to a remote network server (using Windows 2003) that is running an Oracle 10g database. I also need to mention (just in case) that the remote server is also hosting an MS SQL 2005 application as well. I am using the code below (with the first connection string) to connect directly to a version of 10g that is running on the same machine with no problems, however when I try to connect to the network machine, it actually crashes Windows 7. I have tried several variations of connection strings as I feel that I must be making a sytax error somewhere. What concerns me is that I have dual try/catch statements in the application and I do not understand why it simply does not refuse the connection and report the error. I suppose the real question is 'what is the correct syntax for the connection string'....or WHATEVER the hell I am doing wrong. This is my first go around with Oracle (and I am not liking it at all), but it is not a matter of choice for me. SO.........any help or suggestions are greatly appreciated. Thank you in advance...Best Regards, Pat
//Class Variables
//string CONNSTR = "Server=127.0.0.1:1521;User ID=Patt;Password=Mine;";
string CONNSTR = "Server=192.168.2.5:1521;User ID=Patt;Password=Mine;";public Oracle() { InitializeComponent(); } //Methods private void TestMyOracleConnection() { OracleConnection Conn = new OracleConnection(CONNSTR); try { Conn.Open(); MessageBox.Show("Oracle Connection Established", "Success"); } catch (OracleException ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } finally { Conn.Close(); Message
-
Hello js, Thank you for your question....Yes. Since I made the earlier post, I have installed 10g on the local server and everything works perfectly. Although I have gotten great help from the people here, I still have the original issue in this case, so I just uploaded a post to another forum as I am still baffled by this. I will post the new text below. If you have any ideas...I am ALL ears...:-)...Thanks, Pat I have a Windows 7 dev machine used to create .Net applications with VS 2010. I want to connect to a remote network server (using Windows 2003) that is running an Oracle 10g database. I also need to mention (just in case) that the remote server is also hosting an MS SQL 2005 application as well. I am using the code below (with the first connection string) to connect directly to a version of 10g that is running on the same machine with no problems, however when I try to connect to the network machine, it actually crashes Windows 7. I have tried several variations of connection strings as I feel that I must be making a sytax error somewhere. What concerns me is that I have dual try/catch statements in the application and I do not understand why it simply does not refuse the connection and report the error. I suppose the real question is 'what is the correct syntax for the connection string'....or WHATEVER the hell I am doing wrong. This is my first go around with Oracle (and I am not liking it at all), but it is not a matter of choice for me. SO.........any help or suggestions are greatly appreciated. Thank you in advance...Best Regards, Pat
//Class Variables
//string CONNSTR = "Server=127.0.0.1:1521;User ID=Patt;Password=Mine;";
string CONNSTR = "Server=192.168.2.5:1521;User ID=Patt;Password=Mine;";public Oracle() { InitializeComponent(); } //Methods private void TestMyOracleConnection() { OracleConnection Conn = new OracleConnection(CONNSTR); try { Conn.Open(); MessageBox.Show("Oracle Connection Established", "Success"); } catch (OracleException ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Oracle Connection Failed!"); } finally { Conn.Close(); Message
An OS crash is a pretty severe problem and one which has nothing to do with your code. It just simply shouldn't be possible. Some possible avenues. 1. Try it on another machine. Perhaps you have some significant failure (like hardware) on your current box. 2. Try a different Oracle driver, if that is possible. 3. Insure the OS is up to date. Solutions: 1. Is the target run machine going to be windows 7 (or server 2008)? If not then use a different OS for development. 2. Use a proxy server. I would suggest java. That is going to require a lot of work. But your app connects to the proxy app, it does the database work, and then returns the result. The last is a rather severe solution but so is an OS crash.