Hi All,
I have a client connection problem with Oracle.
The exe which i did with C# (vs.net 2005) and Oracle XE , works well on my
developer machine but i am getting a connection string error on the client
side. The error comes from System.Exception class not from OracleException.
The properties of the Oracle.DataAccess reference are ;
Description: Oracle.DataAccess.dll
Runtime Version:v1.0.3705
Version: 10.2.0.100
Path: C:\oraclexe\app\oracle\product\10.2.0\server\bin\Oracle.DataAccess.dll
------------------------------------------------
The sample code is:
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
private void button1_Click(object sender, EventArgs e)
{
OracleConnection cnn = new OracleConnection();
OracleCommand cmm = new OracleCommand();
try
{
cnn.ConnectionString = "USER ID=" + textEdit1.Text + ";PASSWORD=" +
textEdit2.Text +
";DATA SOURCE=" + textEdit3.Text + ";";
DataSet ds = new DataSet();
cmm.Connection = cnn;
cmm.Connection.Open();
cmm.CommandType = CommandType.Text;
cmm.CommandText = "SELECT * FROM FORMS";
OracleDataAdapter ad = new OracleDataAdapter(cmm);
ad.Fill(ds);
gridControl1.DataSource = ds.Tables[0];
cmm.Connection.Close();
}
catch (OracleException oexx)
{
MessageBox.Show(oexx.Message,"From OracleException");
cmm.Connection.Close();
}
catch (Exception exx)
{
MessageBox.Show(exx.Message + " --> " + exx.Source, "From Exception");
cmm.Connection.Close();
}
}
----------------------------------
And the error message is: from (catch (Exception exx) )
'user id' is an invalid connection string attribute --> Oracle.DataAccess
Any idea ?
Thanks in advance for your help.
Adam
Wolf Saenger - 05 Jan 2008 13:23 GMT
Hello Adam,
> Hi All,
>
[quoted text clipped - 53 lines]
> Oracle.DataAccess
> Any idea ?
check the order.
1. Data Source, User, Password
connectionString="Data Source=mysource;user id= AUSER; password=APWD;"
> Thanks in advance for your help.
> Adam
Adam - 05 Jan 2008 13:38 GMT
Hi Wolf,
I changed the order :
cnn.ConnectionString = "DATA SOURCE=" + textEdit3.Text + ";USER ID=" +
textEdit1.Text + ";PASSWORD=" + textEdit2.Text + ";";
but nothing change, there is a same error ..
Wolf Saenger - 05 Jan 2008 13:46 GMT
Hello Adam,
checkout this:
http://www.connectionstrings.com/?carrier=oracle
> Hi Wolf,
>
> I changed the order :
> cnn.ConnectionString = "DATA SOURCE=" + textEdit3.Text + ";USER ID=" +
> textEdit1.Text + ";PASSWORD=" + textEdit2.Text + ";";
> but nothing change, there is a same error ..
Adam - 05 Jan 2008 19:17 GMT
> Hello Adam,
>
[quoted text clipped - 8 lines]
>> textEdit1.Text + ";PASSWORD=" + textEdit2.Text + ";";
>> but nothing change, there is a same error ..
A - 05 Jan 2008 22:15 GMT
none of them solve it ..
christery@gmail.com - 06 Jan 2008 10:36 GMT
if it works from your computer then try tnsping from the client...
just to see if tnsnames is ok... connecting with excel or something to
get a check that something can access that db...
Adam - 07 Jan 2008 15:58 GMT
Thanks All,
Updateing client driver to ODAC1110620 solved the issue...