title: Npgsql.NpgsqlException: ERROR: 42601: syntax error at or near "where"
body: <p>I have the followinf web service in asp.net
  <code></p>
  
  <pre><code>//setup profile
      [WebMethod]
      [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
      public void SetProfile(string userName, string firstName, string lastName, string imageUrl)
      {
          //create and open connection
          NpgsqlConnection profileConnection = new NpgsqlConnection(ConfigurationManager.ConnectionStrings["PrevueConnString"].ToString());
          profileConnection.Open();
  
          //create query and command
          string query = "INSERT into \"Users\" (\"FirstName\", \"LastName\", \"ImageUrl\") values(:fname, :lname, :imageUrl) where \"UserName\" = :user";
          NpgsqlCommand profileCommand = new NpgsqlCommand(query, profileConnection);
  
          profileCommand.Parameters.Add(new NpgsqlParameter("user", DbType.String));
          profileCommand.Parameters.Add(new NpgsqlParameter("fname", DbType.String));
          profileCommand.Parameters.Add(new NpgsqlParameter("lname", DbType.String));
          profileCommand.Parameters.Add(new NpgsqlParameter("imageUrl", DbType.String));
  
          profileCommand.Parameters[0].Value = userName;
          profileCommand.Parameters[1].Value = firstName;
          profileCommand.Parameters[2].Value = lastName;
          profileCommand.Parameters[3].Value = imageUrl;
  
          int result = profileCommand.ExecuteNonQuery();
  
          profileCommand.Dispose();
          profileConnection.Close();
  
          string json = new JavaScriptSerializer().Serialize(result);
          Context.Response.Clear();
          Context.Response.ContentType = "application/json";
          Context.Response.Flush();
          Context.Response.Write(json);
      }
  </code></pre>
  
  <p></code></p>
  
  <p>On invoking the web service, I get the following error:</p>
  
  <p>Npgsql.NpgsqlException: ERROR: 42601: syntax error at or near &quot;where&quot;</p>