San Myat

San Myat

  • NA
  • 41
  • 1.1k

Get the data from the second databse from the config file

Jan 17 2019 1:03 AM
I want to display the data from the second database from the config file to my text box. How can I display the data from the second database in window form?
My code is
<appSettings>
<add key="myConnectionString1" value="server=localhost;database=myDb1;uid=myUser;password=myPass;" />
<add key="myConnectionString2" value="server=localhost;database=myDb2;uid=myUser;password=myPass;" />
</appSettings>
string connStr1 = ConfigurationSettings.AppSettings("myConnectionString1");
string connStr2 = ConfigurationSettings.AppSettings("myConnectionString2");
So, I want to get the data from the myDb2. Please guide me.

Answers (1)