title: Queries work in debug mode but not in deployment mode?
body: <p>I have a C# application and the following is an excerpt from my Web.config file:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="MyDB" connectionString="Data Source=MACHINENAME\\SQLEXPRESS;Initial Catalog=DBName;Integrated Security=True;MultipleActiveResultSets=true" providerName="System.Data.SqlClient"/&gt;
    &lt;/connectionStrings&gt;
    &lt;system.web&gt;
      &lt;authentication mode="Windows" /&gt;
      &lt;identity impersonate="false" /&gt;
    &lt;/system.web&gt;
  </code></pre>
  
  <p>In the code itself, I have a query like this:</p>
  
  <pre><code>[WebMethod]
  public string InsertField(string str1, string str2, string str3)
  {
  
      string sql = @"
            UPDATE DBNAME.dbo.TableName SET Field2 = '{2}', Modified_At=GETDATE() WHERE Field1 = '{0}' AND Field2 = '{1}';
  
            IF @@ROWCOUNT = 0
                INSERT INTO DBNAME.dbo.TableName (Field1, Field2, Field3, Modified_At)
                VALUES('{0}', '{1}', '{2}', GETDATE())
              ";
  
      sql = String.Format(sql, str1, str2, str3);
  
      try
      {
            string ConString = Constants.connString;
            con = new SqlConnection(ConString);
  
            cmd = new SqlCommand(sql, con);
            con.Open();
            cmd.ExecuteNonQuery();
            return "Success";
      }
      catch (Exception x)
      {
            return x.Message;
            //Response.Write(x);
       }
  
  }
  </code></pre>
  
  <p>My web application runs perfectly fine when I debug it but when I publish it, the queries fail. Debugging with Firebug yields the following error:</p>
  
  <pre><code>{
      "d": "The UPDATE permission was denied on the object "TableName", database "DBName", schema "dbo".\r\nThe INSERT permission was denied on the object "TableName", database "DBName", schema "dbo"."
  }
  </code></pre>
  
  <p>Any suggestions on how I can fix this? </p>