Home Forums Programming General C# - Passing parameters on launch RE: C# - Passing parameters on launch

  • Hi,

    So I created the following two connection strings. Based on the launch paramters I want my program to know which database to use while using the same name ConnectionString.

    Where do I create the variable? Would this be on my Form or in Program.cs? Currently I have multiple stored procedures and multiple connections that all call ConnectionString, so to be able to do this would be great.

    <add name="MY_CSharpUtility.Properties.Settings.ConnectionString"

    connectionString="Data Source=server1;Initial Catalog=Database1;Integrated Security=True"

    providerName="System.Data.SqlClient" />

    <add name="MY_CSharpUtility.Properties.Settings.Database2ConnectionString"

    connectionString="Data Source=server1;Initial Catalog=Database2;Integrated Security=True"

    providerName="System.Data.SqlClient" />

    Thanks again!