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 / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

'user id' is an invalid connection string attribute error on Oracle....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam - 05 Jan 2008 13:14 GMT
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...

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.