title: The server principal " " is not able to access the database " "under the current security context
body: <p>In my code two tables are connected and is working fine in local Host.but while i connect the same code to live the code is not working. </p>
  
  <p>Connection String: </p>
  
  <pre><code>string constr = ConfigurationManager.ConnectionStrings["strconstr"].ConnectionString;
  
  string constr = ConfigurationManager.ConnectionStrings["constrHOS"].ConnectionString;
  
  
   private void BindContactPerson(string hdnHospitalContactPersonID)
      {
          BD_Hospital iHospital = new BD_Hospital();
          string constr = ConfigurationManager.ConnectionStrings["constrHOS"].ConnectionString;
          using (SqlConnection con = new SqlConnection(constr))
          {
              using (SqlCommand cmd = new SqlCommand("SELECT D.DepartmentName,DS.DesignationName,hc.ContactPersonName,hc.ContactPersonAddress,hc.Mobile,hc.Phone,hc.AadhaarCardNo FROM HospitalContactPersonDeatils hc LEFT JOIN VAN_SETTING.[dbo].[Department] D ON D.DepartmentID =hc.DepartmentID LEFT JOIN VAN_SETTING.[dbo].[Designation] DS ON DS.DesignationID =hc.DesignationID where HospitalID='" + hdnHospitalContactPersonID + "'    ", con))
              {
                  using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
                  {
                      DataTable dt = new DataTable();
                      sda.Fill(dt);
                      gvCustomers.DataSource = dt;
                      gvCustomers.DataBind();
                  }
              }
          }
      }
  </code></pre>
  
  <p>Error Image:</p>
  
  <p><a href="https://i.stack.imgur.com/rObrk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rObrk.png" alt="**ERROR IMAGE**"></a></p>