I created a Windows Forms solution. I also created a (db.dll) Class Library Project in the Solution what is a database manager Class. I mean inside there add/edit/delete and the details of the connection. I have another Project in the same Solution for my other Classes and Forms. Like a Form where list the whole data from the database. Like where you can add more data into the database.
I can't access any data from my database manager Class across the other Classes what is managing the data on the Forms.
My db.dll can't access any kind of Classes, or Methods in my other Forms. Just one example: My db.dll can't see any DataGridView.
MySqlConnection con = new MySqlConnection("datasource= localhost; database=sampledb;port=3306; username = root; password= ");
con.Open();
DataGridView1.DataSource = null;
MySqlDataAdapter adapter = new MySqlDataAdapter("select * from information", con);
DataTable dt = new DataTable();
adapter.Fill(dt);
DataGridView1.DataSource = dt;
con.Close();
The name 'DataGridView1' does not exist in current context.
How can I access from one Class (in .dll with same Solution) to other Class? I also very interesting how to can communicate two different .dll file in the same Solution?
The db.dll added as Reference and also added as using db.dll;.