title: localhost refused to connect Visual Studio 2013
body: <p>I've been working on a website using ASP.NET MVC, and I have this page in the website where you can directly send the a email form to a specific email address. Before I don't have database for the form, and it's working perfectly the form is sending without any problem but when I tried to add a database for it (cause I want the information to be save at the database at the same time send it) and tried to send it I keep on having this error:<a href="https://i.stack.imgur.com/KsQ67.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KsQ67.png" alt="enter image description here"></a></p>
  
  <p>But when I go to the other page it's working properly. I'm not really sure what the problem is cause I'm new with this kind of stuffs, but maybe the problem is related to this class:</p>
  
  <pre><code>public class RegisterRepository
  {
      //SqlTransaction transaction = null;
      private SqlConnection con;
      //To Handle connection related activities
      private void connection()
      {
          string constr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString();
          con = new SqlConnection(constr);
  
      }
  
  
      public bool Register(TalentInfo model)
      {
          connection();
  
          try
          {
              SqlCommand com = new SqlCommand("SP_INSERT_TALENT_INFO", con);
              com.CommandType = CommandType.StoredProcedure;
              com.Parameters.AddWithValue("@Talent_Name", model.Talent_Name);
              com.Parameters.AddWithValue("@Talent_Email", model.Talent_Email);
              com.Parameters.AddWithValue("@Talent_SelfPromotion", model.Talent_SelfPromotion);
              con.Open();
              int i = com.ExecuteNonQuery();
              con.Close();
              if (i &gt;= 1)
              {
                  return true;
              }
              else
              {
  
                  return false;
              }
  
  
          }
  
          catch
          {
              return Register(model);
          }
          finally
          {
              con.Close();
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>I tried repairing my IIS 8.0 Express, (SSL Enable = True), and other solutions but it still doesn't work. Please someone help me. Thank you in advance. </p>