first of all it is not possible to be still connected unless if your professor have a SQL server intalled in his PC and you have the same server name, but there is still solution to your problem.
1.) instead of connecting to server use the original database to connect (the .mdf file).
2. Copy your database(.mdf) to the debug folder.
3. then use this connection.
string databasePath = Application.StartupPath + "\database.mdf";
string connectionString = "DataSource=.\SQLEXPRESS; AttachDbFilename =" + databasePath +";Integrated Security=True;Connect Timeout=30;User Instance=True"
System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(connectionString);
con.open();
IMPORTANT: include the database(mdf) to the package.