0 Replies Latest reply: May 29, 2012 7:10 PM by J.R.B. RSS

    TableAdapter Configuration Wizard doesn't play nice w/explicit DataSource?

    J.R.B.
      I am having problems using the TableAdapter Configuration Wizard with a non-schema-owner account in a connection string that explicitly defines the data source. The following are the different combinations I've tried, some of which work, some of which do not:


      Scenario #1: If we define a connection string and specify the schema owner's username and password (which we do NOT want to do), and an explicit data source (which we DO want to do), such as the following:

      <add name="SchemaOwnerConnStr"
      connectionString="USER ID=THIS_SCHEMA_OWNER;PASSWORD=thisOwnerPassword;DATA SOURCE=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = our.database.server.com)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = the.service.name) ))"
      providerName="Oracle.DataAccess.Client" />

      ...then the TableAdapter Configuration Wizard works as expected:

      * I choose SchemaOwnerConnStr on the first screen of the Wizard

      * On the "Enter a SQL Statement" screen of the wizard, I can click on the "Advanced Options" button and mark the checkboxes for "Generate Insert, Update and Delete statements" and "Use optimiztic concurrency"

      * On the "Choose Methods to Generate" screen of the wizard, I can mark the "Create methods to send updates directly to the database" checkbox, so it will automatically create Insert, Update, and Delete methods for me.


      Scenario #2: If we define a connection string using Window's Authentication (which we DO want to do), and provide a TNS name (which we do NOT want to do) as the DataSource:

      <add name="MyTNSConnStr" connectionString="USER ID=/;DATA SOURCE=MyDB" providerName="Oracle.DataAccess.Client" />

      ...it works just fine:

      * I choose MyTNSConnStr on the first screen of the Wizard

      * On the "Enter a SQL Statement" screen of the wizard, I can click on the "Advanced Options" button and mark the checkboxes for "Generate Insert, Update and Delete statements" and "Use optimiztic concurrency"

      * On the "Choose Methods to Generate" screen of the wizard, I can mark the "Create methods to send updates directly to the database" checkbox, so it will automatically create Insert, Update, and Delete methods for me.


      Scenario #3: If we define a connection string using Window's Authentication (which we DO want to do), and provide an explicit DataSource (which we DO want to do):

      <add name="MyExplicitConnStr" connectionString="USER ID=/;DATA SOURCE=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = our.database.server.com)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = the.service.name) ))"
      providerName="Oracle.DataAccess.Client" />

      This does NOT work as expected:

      * I choose MyExplicitConnStr on the first screen of the Wizard

      * On the "Enter a SQL Statement" screen of the wizard, I can click on the "Advanced Options" button and mark the checkboxes for "Generate Insert, Update and Delete statements" and "Use optimiztic concurrency"

      * On the "Choose Methods to Generate" screen of the wizard, I can NOT mark the "Create methods to send updates directly to the database" checkbox -- it is greyed out!


      Scenario #4: If we define a connection string using a non-schema-owner's username and password (which under certain limited conditions we DO want to do), and provide an explicit DataSource (which we DO want to do):

      <add name="NonSchemaUser_ConnStr"
      connectionString="USER ID=OTHER_USERNAME;PASSWORD=thePassword;DATA SOURCE=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = our.database.server.com)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = the.service.name) ))"
      providerName="Oracle.DataAccess.Client" />

      This does NOT work as expected:

      * I choose NonSchemaUser_ConnStr on the first screen of the Wizard

      * On the "Enter a SQL Statement" screen of the wizard, I can click on the "Advanced Options" button and mark the checkboxes for "Generate Insert, Update and Delete statements" and "Use optimiztic concurrency"

      * On the "Choose Methods to Generate" screen of the wizard, I can NOT mark the "Create methods to send updates directly to the database" checkbox -- it is greyed out!


      Scenario #5: I use the exact same connection string as in Scenario #4, expect I change it to use the TNS name for the Data Source:

      <add name="NonSchemaUser_TnsConnStr"
      connectionString="USER ID=OTHER_USERNAME;PASSWORD=thePassword;DATA SOURCE=MyDb"
      providerName="Oracle.DataAccess.Client" />

      ...this DOES work:

      * I choose NonSchemaUser_TnsConnStr on the first screen of the Wizard

      * On the "Enter a SQL Statement" screen of the wizard, I can click on the "Advanced Options" button and mark the checkboxes for "Generate Insert, Update and Delete statements" and "Use optimiztic concurrency"

      * On the "Choose Methods to Generate" screen of the wizard, I CAN mark the "Create methods to send updates directly to the database" checkbox, so it will automatically create Insert, Update, and Delete methods for me.


      The ONLY difference between Scenario #4 and Scenario #5 is that for #5 I used the TNS name for the data source. The explict data source defined in Scenario #4 is an exact cut-and-paste out of my tnsnames.ora file for the definition of "MyDb" -- so there should be absolutely no difference between #4 and #5 -- yet with #4, the checkbox is greyed out.

      I can get the same inconsistent results if I do the WinAuth connection string with again the only difference being the Data Source (explicit, or TNS name). So the problem doesn't have anything to do with using the "/" authentication method.

      Summary:

      Schema Owner Username/Pass + Explicit Data Source ....... Works
      Schema Owner Username/Pass +TNS Name Data Source ....... Works

      Non-Schema-Owner Username/Pass + Explicit Data Source ....... Does NOT work
      Non-Schema-Owner Username/Pass + TNS Name Data Source ....... Works

      "/" authentication + Explicit Data Source ....... Does NOT work
      "/" authentication + TNS Name Data Source ....... Works


      The two combinations that don't work are the two that we want to use!

      I can't for the life if me figure out what is possibly "wrong" with the combination that isn't working. As I said above, the explicit data source that does NOT work is an exact copy of the definition for the TNS name that DOES work. They should be functionally identical.

      What am I missing here!?

      Thanks.