none
Persist Security Info && Table Adapter Manager RRS feed

  • Question

  • A Table Adapter Manager handles all its connected Table Adapter Object.
    Before updating, it compares all its TAO Connection strings to be sure they're all equals. (See here my previous thread about this)

    If the main connection string has the property Persist Security Info set to FALSE, when you send a command to a dataset table with a single table adapter (i.e. Fill method) the connection string is reset and the password is hidden (cut away).

    But, then, if you want to update the dataset by a TableAdapterManager.UpdateAll() method, this connection string changes can cause an exception to be risen:
    "All TableAdapters managed by a TableAdapterManager must use the same connection string."

    How can I avoid this, without setting Persist Security Info to TRUE and so creating a hole in the security layer?
    ------- Life is what happens while doing other projects -------
    • Edited by ckumark Friday, June 26, 2009 7:29 PM Fixing thread title bug
    Monday, June 15, 2009 4:08 PM

All replies

  • Hi,

    Using Windows Authentication is highly recommended because user credentials are not exposed in the connection string. If you cannot use Windows Authentication to connect to database, then consider creating connection strings at run time using the SqlConnectionStringBuilder.

    For more information, please see here:
    http://msdn.microsoft.com/en-us/library/ms254947(VS.80).aspx
    http://msdn.microsoft.com/en-us/library/ms254978(VS.80).aspx

    Thanks,
    Jing Li
    • Proposed as answer by Jing Li Tuesday, June 16, 2009 2:55 AM
    Tuesday, June 16, 2009 2:55 AM
  • Sorry. This cannot help me.
    I need SQL Server auth.

    The sqlConnectionStringBuilder need a user to compose the unknown part of the c.s. (i.e. Password), but I want to use always the same User ID and password when the application accesses the database. This has to be done trasparently to the user. Specifically, no authentication required by the user. The application logs in always with the same properties, internally.

    What now?
    ------- Life is what happens while doing other projects -------
    Thursday, June 18, 2009 2:21 PM
  • Can you just create one SqlConnection or DBConnection before hand and assign it to all the adapters and adapterManager as well? Perhaps this is one way to workaround it.

    Thanks
    Chris Robinson
    Program Manager - DataSet
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, June 18, 2009 3:26 PM