Hello,
I have this connection string code below;
string conn = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString.ToString();
SqlConnection cn;
cn = new SqlConnection(conn);
cn.Open();
How can I create a Class/Method to be able to call just a string or variable whenever I need this connection strings on my code page?
I hope my question is clear? Thanks for helping in advance.
Loading

Rajanikant HawaldarRank #110 · 20.2K reputationPosted Apr 9, 2020, 6:23 AM EDT
Ashutosh GuptaRank #805 · 2.9K reputationPosted Apr 9, 2020, 9:16 AM EDT