I want to make a single connection file , using which , all the Forms of my winform application should connect to the online mysql database and select,update & insert data.
I have named the connection file as CONNECTION.CS, connection string is :
OdbcConnection conn = new OdbcConnection("Driver={MySQL ODBC 5.1 Driver};uid=ab ; password=pass;server=www.myweb.com;database=mydb;port=3306");
Now , how do I use it in the Form1.cs,Form2.cs ..........to establish connection to the database and start inserting and retreiving data? Please help.
Do i need to inherit this Connection.cs in all the Forms? Please help with code