locked
problem in connecting .net 2010 to oracle 10g via ODAC 11 RRS feed

  • Question

  • User-1625965328 posted

    hello everyone!!
    i m trying to use ODAC 11 with vs2010 and oracle 10G. After installation i am able to connect the vs2010's server explorer with oracle 10G using ODAC. the thing is when i try to drag the table directly on windows application or web form, it does nothing. there is no way possible to connect any application to the database. i strongly feel that my installation is incomplete. I changes the parameters in tnsname.ora. the only thing i left in installation is executing some sql scripts after installation that are present in "C:\app\dellid\product\11.2.0\client_1\ASP.NET\SQL" folder.
    Plz help
     

    Regards

    Master3G

    Wednesday, November 17, 2010 3:13 PM

Answers

  • User269602965 posted

    I have found using the table drop and drag GUI to create SQL statements for a gridview not helpful to me,

    but then again, I spend more time in programming Oracle than I do programming ASP.NET and WPF.

    Instead, just make your SQL statement directly in the ASP.NET page,

    and later you can learn to do that from Code Behind Form with ODP.NET where you can dynamically create SQL statements,

    and then as a PL/SQL package with ODP.NET for production level coding.

    <asp:Gridview ID=MyGrid runat="server" datasource=dsZipCodes />

    <asp:SqlDataSource ID="dsZipCodes" runat="server"
      ConnectionString="<%$ ConnectionStrings:OraConnStr %>"
      ProviderName="<%$ ConnectionStrings:OraConnStr.ProviderName %>"
      SelectCommand="SELECT ZIP_CODE, STATE, CITY FROM OPTIPLEX.ZIP_CODES">
        <SelectParameters></SelectParameters>
    </asp:SqlDataSource>

    Of course, the connection user account will need select privileges on the table

    And web.config will need your connection string.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 19, 2010 6:06 PM

All replies

  • User269602965 posted

    You do not need to install the scripts for the Oracle Provider "C:\app\dellid\product\11.2.0\client_1\ASP.NET\SQL",

    unless you plan to use a Provider for membership, roles, etc. 

    You might consider presenting your problem on the Oracle Technical Network forums for ODP.NET

    http://forums.oracle.com/forums/forum.jspa?forumID=146

     

     

    Wednesday, November 17, 2010 10:30 PM
  • User269602965 posted

    If the Oracle 11g Client and Oracle 10g database reside on the same computer,

    then make sure the System Environment Path has the 11g bin reference as the first entry in PATH variable. 

    Thursday, November 18, 2010 11:24 AM
  • User-1625965328 posted

    i m not getting much from what you are saying.... but i found something.i created a windows application and then was able to create a dataset from ODAC connection to oracle. then dragging the dataset on windows form... i was able to create a data grid containing the data. hittin F5 the app was running successfull. however when tryin to do same in asp.net...when configuring the data source using sql datasource it gave me following error ...

    ORA-00942: table or view does not exist


    help help

    i m posting this on oracle forums. so plz reply at only one place

    Friday, November 19, 2010 8:42 AM
  • User-1625965328 posted

    sorry for incomplete info in the last problem regarding asp.net 4.0 and ODAC 11.2. when i try to connect datagrid using sqldatasource.while configuring the select statement...we have to make choice between [specify columns from a table or view/specify a custom sql statement or stored procedure] writing custom sql statement works (SelectCommand="SELECT OPTIPLEX.PLAYER.* FROM OPTIPLEX.PLAYER") but choosing a table (SelectCommand="SELECT * FROM &quot;PLAYER&quot;") gives error. this error really looks very wierd. other problems are ..drag and drop of tables from server explorer to webform/window form has no effect(nothing happens on web/windows form)

    im using ODAC 11.2 with vs2010 and Oracle 10G R2 on windows XP professional sp3

    plz help

    Friday, November 19, 2010 9:13 AM
  • User269602965 posted

    I have found using the table drop and drag GUI to create SQL statements for a gridview not helpful to me,

    but then again, I spend more time in programming Oracle than I do programming ASP.NET and WPF.

    Instead, just make your SQL statement directly in the ASP.NET page,

    and later you can learn to do that from Code Behind Form with ODP.NET where you can dynamically create SQL statements,

    and then as a PL/SQL package with ODP.NET for production level coding.

    <asp:Gridview ID=MyGrid runat="server" datasource=dsZipCodes />

    <asp:SqlDataSource ID="dsZipCodes" runat="server"
      ConnectionString="<%$ ConnectionStrings:OraConnStr %>"
      ProviderName="<%$ ConnectionStrings:OraConnStr.ProviderName %>"
      SelectCommand="SELECT ZIP_CODE, STATE, CITY FROM OPTIPLEX.ZIP_CODES">
        <SelectParameters></SelectParameters>
    </asp:SqlDataSource>

    Of course, the connection user account will need select privileges on the table

    And web.config will need your connection string.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 19, 2010 6:06 PM
  • User-1625965328 posted

    yeah after i obtained the results i was a bit satisfied from myself that i m doin ok. Thnx for ur advice...i think people sometimes

    need just a moral support that they are doing good or not!!


    Lot of thanx 2 u

    CrZyLiNk

    Saturday, November 20, 2010 12:24 AM