Well, yes - it will. Look at the code:
conn = new SqlCeConnection();
cmd = new SqlCeCommand("SELECT COUNT(*) FROM Pigeons", conn);
conn.Open();
You have created a connection object, but you don't tell it what you want it to connect to! SqlCE is a file-based database: you have to at the very minimum specify the file you want to use and provide that info to your SqlCEConnection instance.
SQL Server Compact connection strings - ConnectionStrings.com[
^]
string strConnect = @"Data Source=MyFolder\MyData.sdf;Persist Security Info=False;";
conn = new SqlCeConnection(strConnect);
cmd = new SqlCeCommand("SELECT COUNT(*) FROM Pigeons", conn);
conn.Open();