First :
It is a big mistake(security threat) to leave custom errors enabled in web.config file before deploying your application to production server. (Unless you like you server to be hacked formatted or whatever)
Second:
con = new SqlConnection("Data Source=localhost;database=scmtraingdb;user id=sa;password=123");
This looks like the code on the development machine you need to change the connection string according to the server on which your application is hosted. Ask the web space provider or someone with experience in asp.net to configure it. You don't need to change it in code.you may store it in web config file itself.
You need to deploy the database on the web Server too;
Hope it helps!!
Best of luck!!