locked
Please help me connect to Oracle in VS2012/2010 RRS feed

  • Question

  • User-1177406051 posted

    Everywhere I looked I seem to get 80% if the info that I need to add EDMX adn design time for Oracle in VS2012.

    I downloaded and installed the Oracle Client Tools for VS2012.

    I followed a white paper to add a new connection under 'Data Connections/Add Connection'.

    In the dialog that says 'Add Connection' there is no choice for 'Data source name', only (local database).

    I read about modifiying the tnsnames.ora and I added all my server info in there.  Nothing shows up in visual studio.

    Where do I setup a connection so that it is a choice in VS2012?

    ** rant - you can skip this **

    Man, I hate Oracle.

    Seriously?

    Text files in some obscure C drive folder?

    a 200MB download to get a client to work?

    Arrg

    Tuesday, May 28, 2013 3:43 PM

All replies

  • User364663285 posted

    Read

    http://www.wrox.com/WileyCDA/Section/Connecting-to-Oracle-or-Access-from-ASP-NET-2-0.id-292764.html
    http://stackoverflow.com/questions/5581261/connecting-to-oracle-database

    Wednesday, May 29, 2013 12:18 AM
  • User-578610739 posted

    Hi ,

    Before to connect oracle with sql, are you try successfully connect in sqlplus (oracle sqlquery window) or third party like plsql, toad.

    if not then check entry in tnsnames.ora. Each field have specific meaning. If there spelling mistake or silly mistake , then try to change it.  also try to give  ip address or local keyword to connect.

    http://www.orafaq.com/wiki/Tnsnames.ora

    After connect in sqlplus try to connect with vs

    http://www.codeproject.com/Tips/421105/Using-Oracle-with-EntityFramework-4

    Wednesday, May 29, 2013 1:11 AM
  • User-1177406051 posted

    Toad connects fine. Sqlplus gives some error about tns 'protocol adapter error'.

    Checked tns file and replaced all the sample config with my info and no luck.

    Read those links in your email and they just gave me samples of that config file.

    TOAD works fine from my workstation.  SQL plus from same computer does not.

    I dont understand that when there are multiple entries in tnsnames.ora how sqlplus knows what to connect to?

    I have not used Oracle with .NET in 10 years and it is disgraceful that they still use these lousy text files and 'PATH' statements to make this work.

    Thanks for your help though.

    Wednesday, May 29, 2013 8:06 AM
  • User-578610739 posted

    Hi Agent,

    In tns file an entry. for example:

    ORA11 =
     (DESCRIPTION = 
       (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
       )
     (CONNECT_DATA =
       (SERVICE_NAME = ORA11)
     )
    )

    ORA11 SHOW IS YOUR HOST STRING  NAME (if you connect with toad it show combo of list of host string name same as tns file.  The right hand side portion entry used to connect your oracle with this credentials.

    you can check by remove one by one entry in toad and check simultaneously in sqlplus. So it give that entry which connect oracle.

    In tns , minor mistake will not connect the oracle db. If your oracle client is perfect in version , then only tns entry will make issue.

    Please take patience, every problem have one solution. Only thing to find.

    Wednesday, May 29, 2013 9:55 AM
  • User-1177406051 posted

    Yes, I have this done already.  There do not appear to be any mistakes.

    Does the name at the top always need to match the SERVICE_NAME attribute?

    I am assuming it should be my actual SID and not 'ora11' is that correct?

    SQLPlus of course gives almost no info when it cannot connect.

    Can there be more than one entry in tnsnames.ora?  If so, how to I specify in sqlplus what I am connecting to?

    Could this be a 'path' issue?   Meaning the folder for tnsnames.ora cannot be found because it is not in the PATH (remember PATHs fom the 1980's?)

    Thanks.

    Wednesday, May 29, 2013 10:24 AM
  • User-1177406051 posted

    Hi ,

    Before to connect oracle with sql, are you try successfully connect in sqlplus (oracle sqlquery window) or third party like plsql, toad.

    if not then check entry in tnsnames.ora. Each field have specific meaning. If there spelling mistake or silly mistake , then try to change it.  also try to give  ip address or local keyword to connect.

    http://www.orafaq.com/wiki/Tnsnames.ora

    After connect in sqlplus try to connect with vs

    http://www.codeproject.com/Tips/421105/Using-Oracle-with-EntityFramework-4

    Yes, I have read this already and 35 other articles.  I am sure it is something simple, and my lack of experience with Oracle.

    Wednesday, May 29, 2013 10:27 AM
  • User-1177406051 posted

    BTW - I have been reading a lot of similar difficulties and many point to 'path' issues.

    If I do a SET command I do not see anything 'Oracle' related in paths.

    I have tried manually setting a couple from what I have read and no luck.

    Is there a script or something to set proper paths?

    Thanks.

    Wednesday, May 29, 2013 11:01 AM