Like I said, you can either connect to an attached database or attach the database when you connect.

In the former case the application assumes that the database is already attached to the server, so you must either attach an existing database or create a new database before running the application. In that case you would usually do as you are already: build the database in Management Studio. You would then either attach a backup of that database as one of the steps of deploying your app or else build a new database on the server by executing SQL statements.

In the latter case you would add the database to your VS project as an item, just like a form or a class, and then build it in VS. The database, i.e. the MDF file, would be distributed with your app and probably sit in the same folder as your EXE. Each time you connect the database will be temporarily attached to the server and it will be detached again when the connection is closed.

Neither approach is more right or wrong than the other. Each has its advantages and disadvantages. Attaching a database to SQL Server Express on demand is overall more convenient but it does have limitations. Mainly, it's really only suitable for local applications, i.e. apps where there is only one instance accessing a server on the local machine. For multi-user and network apps you'd normally keep the database attached permanently.