multiple mssql connection string in class c#
Need for my app
Have database 2017,2018,2019...I add IN every form connection string
- string BSS_2017 = Properties.Settings.Default.MG_SISTEM_2017CS; string BSS_2018 = Properties.Settings.Default.MG_SISTEM_2018CS;
- string BSS_2019 = Properties.Settings.Default.MG_SISTEM_2019CS;
- string con;
- public popis()
- {
- InitializeComponent();
- yearlabel.Text = getYear();
- }
- private String getGodina()
- {
- string value = login.godina.ToString();
- return value;
- }
- public void PullData()
- {
- if (yearlabel.Text == "2017")
- {
- con = BSS_2019;
- }
- else if (yearlabel.Text == "2018")
- {
- con = BSS_2018;
- }
- else if (yearlabel.Text == "2019")
- {
- con = BSS_2019;
- }
- }
That work fine...but...I must put this in every form in my app....need help
To create some class with this value.
Help?
Amit MohantyPosted Jul 25, 2019, 4:17 AM
Amit MohantyPosted Jul 25, 2019, 4:56 AM
Goran BibicPosted Jul 25, 2019, 4:33 AM
Amit Mohanty
Goran BibicPosted Jul 25, 2019, 4:11 AM
Rajanikant Hawaldar
Rajanikant HawaldarPosted Jul 25, 2019, 4:09 AM
Goran BibicPosted Jul 25, 2019, 4:09 AM
Jaish MathewsPosted Jul 25, 2019, 3:49 AM