I’ve created a SharePoint web part. The web part makes use of a custom database. During installing my web part I get the database name and the login details for accessing the database. I need to read these values given during the installation in my application and connect to the database.
Where I can store/retrieve these values? Since my application resides inside an asp.net web application how easily can I achieve this?
I would recommend that you avoid the SPPersistedObject altogether and store things in the SPPropertyBag at the farm, web app or site level.
More details why in this answer, including links to code samples such as the MSDN – SharePoint Guidance library.
SO – Read/Write from/to Hierarchical Object Store – SharePoint