This discussion is archived
1 Reply Latest reply: Sep 11, 2006 3:41 AM by 533001 RSS

Unable to Connect - illegal attribute in connection string

525217 Newbie
Currently Being Moderated
I've started using Oracle Database 10g Express Edition and ODP.net.
with Visual Studio 2005 Professional Version.
I want to start using odp.net with vb.net and C# and the Oracle.DataAccess.Client.

I started sample application from ODP webpage
http://www.oracle.com/technology/pub/articles/cook_dotnet.html
When set connection using this code:

string oradb = "Data Source=(DESCRIPTION="
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=OTNSRVR)(PORT=1521)))"
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCL)));"
+ "User Id=scott;Password=tiger;";

OracleConnection conn = new OracleConnection(oradb);
conn.Open();



I get this error.
ORA-24315: illegal attribute type
So I simplified my string connection string to:
string oradb = "Data Source=ORCL;User ID=scott;Password=tiger;";

I verified access with TOAD and ORACLE Developer. (Yes, it works)
I also reviewed my tnsnames.ora and it has ORCL as the Service name.


I noticed that the Visual Studio Data Connection Object in the Visual Studio Environment is formated as ORCL.scott. I can rename it to ORCL. It also can
connect to the database just fine. Doesn't seem to depend on tnsnames.ora.
So it seems to me the oracle.data.access is failing on me and I'm not the syntax correct. So what's going on with my program. Any ideas?



Also, Could you clarify which download I should be using. I'm afraid I might have wrong one.

Oracle Developer Tools for Visual Studio .NET with Oracle10g Release 2 ODAC 10.2.0.2.20
Oracle10g Release 2 ODAC 10.2.0.2.20
Oracle Developer Tools for Visual Studio .NET (for Oracle Database10g Express Edition)
Oracle10g ODAC 10.1.0.4.0
Oracle Developer Tools for Visual Studio .NET 10.1.0.4


Update: I reviewed my installation history and have the following:
I installed Oracle Express home on my c:drive and Oracle 10g home on my D: drive and I am using SQL Express 2005. So now I have the following:

Local XE version
C:\oraclexe\app\oracle\product\10.2.0\server (server?? - don't know why?)
Oracle.DataAccess.dll version 10.2.0.100

Local 10g version
d:\oracle\product\10.1.0\client_1
Oracle.DataAccess.dll version 10.1.0.400


Hope you have ideas to help. Thanks
  • 1. Re: Unable to Connect - illegal attribute in connection string
    533001 Newbie
    Currently Being Moderated
    Hi,

    I added a sample VS 2005 project which uses an Oracle XE database at http://www.kodyaz.com/files/21/visual_studio_2005_projects_on_oracle_database/default.aspx

    This VB.NET project connects to Oracle Database and executes an sql command (a select query) over the database in order to display the results on a DataGridView object.

    I hope the sample will help you.

    You can also use the Server Explorer window to create a connection to the Oracle Database.

    Eralper
    http://www.kodyaz.com