locked
ADO.NET CONNECTION TECHNICAL QUESTION RRS feed

  • Question

  • Hi,

           I have a technical question reagrding the way c sharp handles ado.net connections.

        We are using  as/400. We have developed few .net applications. I am trying to understand best practices for using ado.net.

    For example, when we establish as/400 connectivity in .net (let us say windows forms), we require as/400 user id and password. We are using IBM ado.net iseries access provider.

    The user will get a prompt to enter as/400 user id and password (when we try connect to database). Once entered, connection will be established

    Now the problem is how to mainitain the connectivity when using other forms (part of same application)

    I can close the connection and open the connection. But it will be inconvenient for user to enter userid and password every time. I am not sure

    As a solution, I have used modules in vb.net and static in c# for connection

    I understand that for scalibilty and performance point of view, it is best to close database connections and also use less connections

    Is there any alternative way of solving this

    Thank you

    Suneel

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Thursday, May 5, 2011 4:01 PM

Answers

  • See the below link for ADO.NET best practices. There is a section that discusses connections.

    You can always retain user credentials (user ID and password) in memory while the app is running or write them to a configuration file, encrypted, for use in subsequent database connections.

    Best Practices for Using ADO.NET

     


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by SuneelReddy Monday, May 9, 2011 8:49 PM
    Thursday, May 5, 2011 11:23 PM

All replies

  • See the below link for ADO.NET best practices. There is a section that discusses connections.

    You can always retain user credentials (user ID and password) in memory while the app is running or write them to a configuration file, encrypted, for use in subsequent database connections.

    Best Practices for Using ADO.NET

     


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by SuneelReddy Monday, May 9, 2011 8:49 PM
    Thursday, May 5, 2011 11:23 PM
  • Thank you

    Monday, May 9, 2011 8:49 PM