title: Connection String generated by VS doesn't work, and any variation of it
body: <p>I'm deploying a web application using IIS and ASP.NET CORE.
  I setup a "appsetting.json" file that include a connection string to sql server.
  So far, any variation I've tried didn't work.
  The strange thing about it, is that it works perfectly on a my local machine, but when I deploy it and send an HTTPPost, log file says there's an error using connection to database on server.</p>
  
  <p>Well, I tried all variations I could think of.
  Current connection string generated by Visual Studio is :</p>
  
  <blockquote>
    <p>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=Swap;Integrated
    Security=True;Connect Timeout=30;Encrypt=False;
    TrustServerCertificate=False;
    ApplicationIntent=ReadWrite;MultiSubnetFailover=False</p>
  </blockquote>
  
  <p>I've tried changing the "Integrated Security" to False.
  I've tried to replace it with User ID and password (of "sa" user).
  I've tried adding a "Initial Catalog" property and set it to my database.</p>
  
  <p>I'm preety sure the startup of the app is fine, because when I try to send a GET request to the main page, everything seems fine.
  When I send a POST request and asks the DBcontext to Add and SaveChanges, it shows this error :</p>
  
  <blockquote>
    <p>fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
    An error occurred using the connection to database 'Swap' on server<br>
    '(localdb)\MSSQLLocalDB'.</p>
  </blockquote>
  
  <p>This is the function that I tried to send a HTTPPost request to:</p>
  
  <pre><code>byte[] j = new byte[(int)Request.ContentLength];
  Request.Body.Read(j, 0, (int)Request.ContentLength);
  string str = Encoding.ASCII.GetString(j);
  TokenSet tokenSet = new TokenSet {Token = str };
  sqlTokensetData.Add&lt;TokenSet&gt;(tokenSet);
  sqlTokensetData.SaveChanges();
  HttpClient notificationSender = new HttpClient();
  HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, 
  "https://fcm.googleapis.com/fcm/send");
  
  request.Headers.TryAddWithoutValidation("Authorization", "key=" 
  &lt;somekey&gt;);
  
  request.Headers.TryAddWithoutValidation("Sender", "id=&lt;id&gt;");
  Message pushNotification = new Message(new string[] { str }, "Success!" 
  &lt;somestring&gt;);
  
  request.Content = new 
  StringContent(JsonConvert.SerializeObject(pushNotification)
  ,Encoding.UTF8,"application/json");
  
  HttpResponseMessage output = await notificationSender.SendAsync(request);
  </code></pre>
  
  <p>Log file error:
  <a href="https://anotepad.com/notes/9a8jxa" rel="nofollow noreferrer">https://anotepad.com/notes/9a8jxa</a></p>
  
  <p>I hope that the "str" string will be inserted to the database.
  Thank you.</p>