Hello all ADO/DataBinding Gurus.
I will start by mentionning that I'm fairly new to Databinding/.Net/C#.
I am currently developping a small management tool for our company to access a SQL database we are running.
I created different user account in the database having different previleges.
What I wanted to do, is to have a login form at the beginning of the management tool to allow the user to enter their own credentials. After that some read/write access teststo the different table would be perform and would help define the tables that the user would be able to have access (see).
The problem that I am having is related to the connection string. It is stored in the app.config (settings.settings) as a connectionstring under application type which makes it impossible to edit at runtime.
So I figured lets append the username/passform I retreive from the login form to the string right before creating the connection. The problem is that the following code is generated by the compiler so I can't edit it.
Code Snippet
[System.Diagnostics.
DebuggerNonUserCodeAttribute()]
private void InitConnection()
{
this._connection = new System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = global::MY_Management_Tool.Properties.Settings.Default.MYConnectionString;
}
I have been searching for quite a while now and still haven't found a simple solution.
Am I trying to do something impossible ? Is my vision of thing just wrong ?
Any input would be greatly appreciated.
Regars,
Sly.