Ramco Ramco

Ramco Ramco

  • 439
  • 3.4k
  • 544.3k

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)