Hi,
I am developing a small tool using Visual c#2005 which is used to get the
Oracle Schema version. When I tested it in my machine it works fine. When
my boss tested the same in his machine it brings out the message TNS-NO
LISTENER. He says listener is running in his machine & says the problem is
in the code (He is an Oracle DBA and is in this field for nearly 15 years).
The code is just a few lines & I think there is nothing wrong in it. I
don't know how to solve this problem. I have tested it in my machine at
home, it works good there also.
I am a novice when it comes to Oracle & wondering where the problem could
be. Please find below the code I have used.
private void VERSIONANALYZER()
{
try
{
//Connection method :1
sconnect = "Server = Servername; Uid = username; password = password";
//Connection method :2
//sconnect = "user id = username e; password = password;data source = //
Servername;"; conn.ConnectionString =
sconnect.ToString();
try
{
string squery = "SELECT VERSION FROM VERSIONS";
cmd = new OracleCommand(squery, conn);
cmd.Connection = conn;
this.conn.Open();
dr = cmd.ExecuteReader();
bool abc;
abc = dr.Read();
if (abc == true)
{
string sversion = "Oracle Schema Version : " + dr["VERSION"].ToString();
MessageBox.Show(sversion.ToString());
}
}
catch (Exception EXE)
{
MessageBox.Show(EXE.Message, "VERSION ANALYZER",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
finally
{
this.conn.Close();
}
}
}
I will be really thankful if some one guide me in solving the issue.
--
Thanks & Regards,
Karthikeyan