Configuration.SectionInformation.ProtectSection generates two connection strings for one

I am trying to encrypt the connection string section in the config file. There is only one connection string in the original config file, that is a oracle connection string. But after encryption, there are two connection strings.
The original config file is like
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <connectionStrings>
  <add name="Ref_ConnectionString"
   connectionString="Data Source=aaa;User ID=bbb;password=ccc"
   providerName="System.Data.OracleClient" />
 </connectionStrings>
 <appSettings>
  <add key="sp_AddRefName" value="sp_AddRef"/>
 </appSettings>
</configuration>
The coding to encrypt is like:
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(configFile);
ConfigurationSection section = (ConfigurationSection)config.GetSection("connectionStrings");
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
section.SectionInformation.ForceSave = true;
config.Save(ConfigurationSaveMode.Full);
And I am using the following coding to test the decryption:
System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(configFile);
ConnectionStringsSection connSection = config.ConnectionStrings;
int i = 1;
foreach (ConnectionStringSettings settings in connSection.ConnectionStrings)
Console.WriteLine(i.ToString() + ":" + settings.ProviderName + ";" + settings.ConnectionString);
i++;
The output for the decryption are as following:
1: System.Data.SqlClient;data source=.\SQLEXPRESS;Integrated Security=SSPI;Attach
DBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true
2: System.Data.OracleClient;Data Source=aaa;User ID=bbb;password=ccc
Could any of you tell me what I am doing wrong? Thanks.

For the benefit of anyone who comes across this question:
configFile, is meant to be the exePath. OpenExeConfiguration will open the exe's config file and then encrypt it, and then save a "{exePath}.config" file.
If you use notepad to check then you will see encrypted strings.
If you want to use code to check use:
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(exePath);
config.GetSection("connectionsStrings").SectionInformation.IsProtected
If you use code to read the config file, then that will only show decrypted values (#2 in the listed output)
The extra data connection (#1) comes from a config file higher up in the hierachy, e.g. machine.config

Similar Messages

  • Bank Transfer file: generate two outgoing files for one pmt method?

    Hello Experts,
    Two files (header and item) are expected from the hungarian bank for each payement.
    It's possible to generate two outgoing files for one pmt method using DMEE tree? If yes, can you tell me how?
    If not, there is an other solution? Use a classic program (copy and adaptation) for example?
    Thank you in advance.
    Amal

    Are you sure you need separate files file header and items.
    Usually both header and items are placed in the same file. Please reconfirm or get the formats from the Bank.

  • How to configure to generate two accounting documents for Mvt 645

    Dear Experts,
    I read all documents related to STO one-step procedure (mvt 645). They said that the system generate two accounting documents for 2 company codes (receing and issuing company codes) after goods issue reference to DO.
    However, after configuration one step procedure and test my system, the system only generated one accounting document for receiving company code, not for issuing company code. In Material document, I saw 2 Mvt 645 and 101. In the lines having Mvt 645, I saw G/L account of cost-of-goods-sold.
    Could you please to show me how to generate two accounting documnets automatically after goods issue referent to DO with Mvt 645?
    Thank you so much,
    Best regards,
    Anh Duong

    My configuration steps are:
    Step 1: preparation:
          create customer and vendor master
          extend sales & purchasing views for material master
    Step 2: Assign customer number and the organizational units (sales organization, distribution channel, and division) to the Supplying plant and Receiving plant
    IMG --> Materials Management --> Purchasing --> Purchase Order --> Set up Stock Transport Order --> Define Shipping Data for Plants
    Step 3: tick on column "One step" for the line of supplying, receiving plant, and PO type cross transport order
    IMG --> Materials Management --> Purchasing --> Purchase Order --> Set up Stock Transport Order --> Assign Document Type, One-Step Procudure, Underdelivery Tolerance
    Step 4: assign delivery type NLCC for PO type cross transport order
    IMG --> Materials Management --> Purchasing --> Purchase Order --> Set up Stock Transport Order --> Assign Delivery Type and Checking Rule
    These above steps are in MM module.
    Please help me,
    Thank you,
    Anh Duong

  • How to change connection string for a form created with b1de

    Hi all
    i've created a form using the Code Generator tool ob B1DE
    My question is how can i set the connection string to a different server and database. doing so after the creation wizard has finished?

    Hi,
    Why do you need to change the connection string? What are you calling "connection string for a form"???
    The only connection string I now about is the one used to connect to the UI API... and this one is fixed for all apps in debug mode and given as parameter when your addon is registered in B1.
    The connection string is filled in the code of your generated addon.
    Please go to the main class of your addon, in the main method you have the following code where the connection string is filled either with the command line parameters (release mode) or with the fixed value given by SAP. This code doesn't need to be changed...
            public static void Main()
                int retCode = 0;
                string connStr = "";
                bool diRequired = true;
                // CHANGE ADDON IDENTIFIER BEFORE RELEASING TO CUSTOMER (Solution Identifier)
                string addOnIdentifierStr = "";
                if ((System.Environment.GetCommandLineArgs().Length == 1)) {
                    connStr = B1Connections.connStr;
                else {
                    connStr = System.Environment.GetCommandLineArgs().GetValue(1).ToString();
                try {
                    // INIT CONNECTIONS
                    retCode = B1Connections.Init(connStr, addOnIdentifierStr, diRequired);
    Regards
    Trinidad.

  • Hi expert,Incorrect connection string for addon

    hi expert
    I am getting error when connect  my addon in client pc.
    my addon working fine in server at client side.
    but in client i m getting error "Incorrect connection string for addon".in my addon i am using crystal report and two sap b1 user form. thanks in adva.
    regards
    Rajkumar Gupta
    Edited by: Rajkumar Gupta on May 23, 2009 12:49 PM

    Hi Rajkumar,
    Sometimes this error message is related to the UI server. Please see note 808354 or 852031 and see if this has any effect.
    If not, please post up a code sample so we can take a look,
    Regards,
    Niall

  • How to dynamically set connection string for report in C# code?

    Hi,
    I have installed CRVS2010. I have created new Crystal Report WPF Application and new report. I would like to set connection string for report in code dynamically.
    Is this possible?
    Thanks
    Ivana

    Lots of posts in this forum on how to set database connections. WPF should not be a consideration as it's just a viewer. The report engine is still the same. Search these forums. Use the search box at the top right corner of this page. Look at samples here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Note that none of the samples above are using WPF, but like I said, the WPF is just a different viewer and will not impact how the report engine logs on to a database. (I think of it as a gray car vs. a red car. Same engine, just the color is different)
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Save Query - An error occurred while creating connection strings for the query

    A workbook trying to edit and reload I get the following error "Save Query - An error occurred while creating connection strings for the query" No Power Pivot data model or anything.

    I am getting the same error when editing a Power Query in an Excel spreadsheet. It happens when I change a Group By step to do a Sum instead of Count Rows.

  • Report Designer odbc connection string for data source using a parameter

    I am using stand alone report designer 3 for the present and have a question/problem regarding the odbc connection string for MySQL when setting up the data-source
    I need to be able to enter a parameter which is the database name i.e. BOE-201401 or say BOE-201312 etc  from a list of databases the user can choose from.
    at present the odbc connection string points to BOE-201402
    the connection string is at present  Dsn=Development Server for MYsql;description=MYSQL;server=ldndw01;database=BOE-201402;port=3306
    my parameter has the name BOE_DATABASE
    and in an expression it is  as such
    =Parameters!BOE_DATABASE.Value
    I want to point the datasource for the report to the parameter value before the user sees the report.

    Hi Leslie,
    Based on your description, we want to design a report with a dynamic DataSource connection string. There are the basic steps below for your reference:
    Create report with static database.
    Change data source to report parameter.
    Send new database connection string as a report parameter. 
    More detail information, please refer to the following blog: Dynamic Database in SSRS 2008.
    http://haseebmukhtar.wordpress.com/2011/11/09/dynamic-database-in-ssrs-2008/
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • What are the username, password and connect string for Designer 6.1.1?

    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    - Server name
    - Filename
    Oracle designer6.1.1
    - Date/Time
    - Browser + Version
    IE 6.0
    - O/S + Version
    Win 98
    - Error Msg
    ORA-12154:TNS:could not resolve service name.
    RME-00220:Fail to connect to repository
    These error messages were shown after I entered system, manager and internal, respectively.

    Hi YungJen Chen,
    There is no general username, password and connect string for
    Designer 6i Release 4.1.1.
    First, you install the client tools using the Installer. See also the
    Designer Installation Guide, Chapter 1, 'Client Side installation'.
    Second, you install the repository into an existing database, using
    the Designer Installation Guide, Chapter 2, 'Server-side installation,
    migration and upgrade'.
    The Installation Guide provides step by step instructions on what
    users you need to create for various purposes. Any database users
    you may need to use such as System or Sys will use the password
    given when you installed the database, or whatever passowrd you
    changed it to since.
    The Installation Guide is available as part of the download, or from
    your Windows Start Menu once the Designer client tools are installed
    or from the Designer Documentation page here on OTN.
    Hope this helps. Regards,
    Dominic Battiston
    Designer/JDeveloper Product Management

  • What are the username, password, and connect string for Designer6i R4.1.1

    As the title, I tried system, manager and internal.
    But it did not work out.
    Thank you for your help.

    Hi YungJen Chen,
    There is no general username, password and connect string for
    Designer 6i Release 4.1.1.
    First, you install the client tools using the Installer. See also the
    Designer Installation Guide, Chapter 1, 'Client Side installation'.
    Second, you install the repository into an existing database, using
    the Designer Installation Guide, Chapter 2, 'Server-side installation,
    migration and upgrade'.
    The Installation Guide provides step by step instructions on what
    users you need to create for various purposes. Any database users
    you may need to use such as System or Sys will use the password
    given when you installed the database, or whatever passowrd you
    changed it to since.
    The Installation Guide is available as part of the download, or from
    your Windows Start Menu once the Designer client tools are installed
    or from the Designer Documentation page here on OTN.
    Hope this helps. Regards,
    Dominic Battiston
    Designer/JDeveloper Product Management

  • SQL 2000 ODBC CONNECTION STRING FOR SQL 2008

    i have vb 6 application. Database is SQL server 2000.
    my connection string is (using odbc driver),
            .ConnectionString = "Driver={SQL Server};SERVER=" & mServer & ";DATABASE=mydb;UID=" & mLogin.Username & ";pwd=" & mLogin.Password & ";"
    Now i have tried this application with SQL server express 2008 R2
    Can i still keep the old connection string? will there be any problem in future?
    (if i have to change then have to change at so many places.....)
    I can run application without any problem for now (not changed connection string to new one)
    otherwise i have to use ODBC or OLEDB which are,
            .ConnectionString = "Driver={SQL Server Native Client 10.0};SERVER=" & mServer & ";DATABASE=mydb;UID=" & mLogin.Username & ";pwd=" & mLogin.Password & ";"
    or
            .ConnectionString = "Provider=SQLNCLI10;SERVER=" & mServer & ";DATABASE=mydb;UID=" & mLogin.Username & ";pwd=" & mLogin.Password & ";"
    if i have to change to new connection string Which one is better to use odbc or oledb.
    h2007

    personally I favor ODBC as it is easy to use sometime. Additionally you can check the link below:
    http://social.msdn.microsoft.com/Forums/en/sqlintegrationservices/thread/19e0c306-0be4-46b5-b207-0937931d63a7 
    cheers!!!
    Vatsa
    www.objectiveprogramming.com

  • Connection string for Oracle in instantclient11_1 Driver without TNS

    We have Oracle DB without tnsnames.ora.
    We are able to connect to the DB using sqlplus from a command line with the following connection string:
    username/Password@DomainAdress:Port/DataBaseName.DomainAdress
    SYS/****@computerName.Domain.net:1523/DataBaseName.computerName.Domain.net
    If we try to connect from the command line only with the DB name and not the FQDN – the connection fails.
    We would like to connect  using Driver={Oracle in instantclient11_1} We tried the following connection string:
    Driver={Oracle in instantclient11_1};Dbq= computerName.Domain.net:1523/ DataBaseName.computerName.Domain.net;Uid=SYS;Pwd=**** as sysdba
    We got the following Error:
    [Oracle][ODBC][Ora]ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    What should be the right connection string for Oracle in instantclient11_1 Driver?

    Thanks for the confirmation.

  • Manage two invoice posting for one price condition in sales document

    Hello Experts,
    I am a new user in SD module especially for billing and pricing part, and i have a specific requirement from my client that i cannot find the solution. Could you please help if you have any idea to resolve the following situation:
    I have a plant in UK which create a sales order for a customer X for a material M with a specific amount.
    For the invooice creation, the goal is to create two invoices:
    - One with net value billed in USD,
    - one with GBP to bill the tax.
    I tried to use billing plan, and i was able to generate the 1st invoice without tax through pricing procedure that don't manage Tax condition, however i am blocked when trying to generate the second invoice that contains only the tax.
    Do you have any idea how can it be managed?
    Thanks for help
    I can add more clarification if needed.
    Thanks

    Hello,
    Thanks for feedback.
    In fact the Customer master data currency is USD, and company code is in UK so it is GPB.
    The target is for some business case the customer is invoiced with Net value in USD, and the tax will be invoiced in GBP.
    But the problem is that i cannot manage two currencies and two invoices for one price condition.
    So I am wondering what is the best solution, How i can generate two output types for the same price condition.
    I tried to set up pricing procedure without tax, to manage the Net value, in first line of the billing plan.
    But i am not able to generate a seconde line with only the tax condition.
    DO you think that is possible?
    Thanks

  • Can you have two iCloud accounts for one Apple id?

    Can you have two iCloud accounts for one Apple id?

    the appleID is you in the ios world if you have an iphone and an ipad and an Ipod touch and an appletv and a mac then you should use 1 appleID on all of them it does not mean the same data is on all of them unless you want it to be

  • To enter two VAT numbers for one vendor in the same country

    Hello All,
    When we try to enter two VAT numbers for one vendor in the master record and belongs to the same country, the system is not allowing and gives the following message,
    "VAT reg.no. already exists for country BE"
    Message no. F2140
    Kkindly let me know the way to proceed further.
    Many thanks in advance.

    Hello,
    Go to OBA5 and switch off the message for online and batch entries.
    If the message is already not there in OBA5,
    Then go to OBMSG and switch off the same.
    Application Area F2
    Message No.140
    Regards,
    Ravi

Maybe you are looking for

  • Cannot update Acrobat Pro 9.3.0

    get the following message The patch has failed because the application has been modified since it was originally installed (for example, plug-ins may have been disabled). I went to the Adobe support website and found no solution.  Is this a Snow Leop

  • Managing Files and Folders in Lightroom - Mac

    I created a subfolder by mistake. Examination via iMac Finder shows that all files in the subfolders are duplicates of those in the main folder (which contains additional files as well). Catalog view shows many of the files in the main folder are alr

  • Write digital output on wireless node

    hello i have wsn kit with 9791 gateway, i need to program node 3202 to write a digital output, i want to know how can i do this in labview ? do i have to write program ? what library in labview should i chose ? is it using FPGA module in labview ? i

  • Workflow in visual studio 2013.

    I am trying to create Workflow in visual studio 2013.  Workflow scenario is to collect data from reviewer ( comments and other data) and update comments to list item and send those comments to requester in email and based on data entered by reviewer,

  • Symbol exsltDateXpathCtxtRegister: referenced symbol not found

    hello all, i have to deploy an application that uses the lxml HTML parser (http://lxml.de). This lib compiles fine into a S11 zone, but i'm unable to use it due to this error: from lxml import etreeTraceback (most recent call last): File "<console>",