Ramco Ramco

Ramco Ramco

  • 462
  • 2.8k
  • 398.5k

Sql Connection in Windows Form

Apr 18 2024 4:18 PM

Hi

  I have created below Class. I want connection should be called once for all forms. I am using Windows Form Application

class DBConnection
    {
        public SqlConnection con;
        public void Connection()
        {
            con = new SqlConnection("Data Source = .;Initial Catalog = Pl_Live; Integrated Security=true;");
        }
    }

Thanks


Answers (2)