You have the words "Data Source" twice in your connection string.
You could also change your function so it can also be used outside of a WinForms app sorta like this:
private static bool readDatabase(ref string strError)
bool blnRetVal = true;
// Define the Select statement.
string selectSQL = "SELECT name, surname FROM Players";
using (OleDbConnection conn = new OleDbConnection(connectionString))
using (OleDbDataReader rdr = (new OleDbCommand(selectSQL, conn)).ExecuteReader())
// Populate player
catch (Exception exc)
blnRetVal = false;
strError = exc.Message;
...then it can be called like this:
static void FunctionThatUsesTheData()
string strError = "";
if (!readDatabase(ref strError))
// Display ErrorMessage Here
// MessageBox.Show or Console.WriteLine, etc...
return; // <-- RETURN!
// more code goes here
Another benefit is that the variables have a more limited scope and you won't have to figure out if the database is open or closed.
I "smothered" that OleDbCommand because it only has one purpose (to bring you the OleDbDataReader).
Of course, if you were adding parameters (or doing something else with it), it should have its own variable.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...