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

  • rayh 98086 (7/8/2013)


    Hi,

    Thank you for the risk you took as I sincerely appreciate the help and is working as needed. =)

    I also need to have this parameter decide on what image to display and what database to point to.

    For eample, if the value is not zero than show picturebox "B" instead of the default "A".

    Same for database, I have two databases as I want to use the same front end for two different companies for the time being (which is what this parameter is really going to be used for. If the value is not zero than connect to based "B" instead of the default "A". However, I would like to keep the same connectionstring name.

    Are these options possible? I have been digging in but isn't as clear cut as I thought it would be.

    Thanks again for your help!!!

    There really is no risk of posting programming questions where you did. You just don't have as good of odds at getting a good answer. 😉

    The picturebox part should be pretty straight forward. The easiest way to deal with your connection string issue is to have 2 connection strings in your config file. Then populate a string variable much the same way you deal with your parameters. Then your application always refers to the same string but the contents can vary passed on your parameter.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/