
Originally Posted by
Jaynno
so if i understand i put the username and password in variable like this :
$user = "theuserhere"
$pass = "thepasswordhere"
then in the connection string i put the variable ???
and those variable are declared in the main class ?
No, you don't declare the variables in the main class... That would cause the exact same security issues. The variables should be stored in the application settings, like I said.
Project -> Properties -> Settings
Then use it like this:
Code:
connectionString = String.Format("Data Source=localhost;Initial Catalog=Gamedb;User ID={0};Password={1}", Properties.Settings.user, Properties.Settings.pass);
NOTE: There's no need to declare the types of your variables and their values seperately. Instead of
Code:
string blah = null; blah = "asd";
just do