title: ASP.Net web application connect to host SQL DataBase
body: <p>I have a simple Web API Application and I want to connect it to a DataBase presents in my host. This is in my web.config:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="JarasDB" connectionString="Data Source=localhost;Initial Catalog=JarasDB;Integrated Security=True;" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>And I'm going to test it with following codes:</p>
  
  <pre><code>public string Get(int id)
  {
      string connectionString = ConfigurationManager.ConnectionStrings["JarasDB"].ConnectionString;
      using (SqlConnection con = new SqlConnection(connectionString))
      {
          try
          {
              //
              // Open the SqlConnection.
              //
              con.Open();
              //
              // The following code uses an SqlCommand based on the SqlConnection.
              //
              using (SqlCommand command = new SqlCommand("CREATE TABLE Customer(First_Name char(50),Last_Name char(50),Address char(50),City char(50),Country char(25),Birth_Date datetime);", con))
                  command.ExecuteNonQuery();
  
          }
          catch (Exception ex)
          {}
      }
      return strings[id];
  }
  </code></pre>
  
  <p>After publishing project in my host what happens is The Connection String will be add in ASP.NET Configuration page in Plesk panel:<a href="https://i.stack.imgur.com/TKEeN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TKEeN.jpg" alt="plesk panel"></a></p>
  
  <p>After calling Get method I expect to create a table in my database but nothing happens. I want to know where is my problem.
  <a href="https://i.stack.imgur.com/iEyIz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iEyIz.jpg" alt="phpMyAdmin"></a> </p>