Hi
I want to create connection only once in windows form project. How it can be done
cn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=H:\Website\RegistrationAndLogin\Database.mdf;Integrated Security=True");
cn.Open();
Thanks
Jignesh KumarPosted Aug 14, 2024, 11:41 AM
Hello Ramco,
You can create sington database connection class and use it,
use this connection in your all form like below,
Ramco RamcoPosted Aug 14, 2024, 11:59 AM
Hi Jignesh
It is giving message - DatabaseConnection does not contain a definition for Instance.
Thanks