The connection string is the database in the source folder of the project. It is not right; when you deploy software, you do not deploy source code. You must determine the path to the expanded data. There are several ways to do this, depending on the information that you did not show us.
As you might guess, try the following:
SqlCeConnection cs = new SqlCeConnection(@"Data Source=|DataDirectory|\DB.sdf");
, . , , .
, .NET.