So I have this class (Add > New Item > Class)
Code
class DataSetConfiguration
{
private const string CONNECTION_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\xtreme.mdb";
private const string QUERY_STRING = "SELECT * FROM CUSTOMER";
private const string DATATABLE_NAME = "Customer";
public static DataSet CustomerDataSet
{
get
{
CustomerDataSetSchema dataSet = new CustomerDataSetSchema();
OleDbConnection oleDbConnection = new OleDbConnection(CONNECTION_STRING);
OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter(QUERY_STRING, oleDbConnection);
oleDbDataAdapter.Fill(dataSet, DATATABLE_NAME);
return dataSet;
}
}
}
Now I would like to go to my Form1.cs and call this class and use its property and show the All Records in a dataGridView
How would I do this?
Can't find any example online that somebody did this way.