im stuck with this code. i Dont have any idea why delete queries are not executing but update query does.

 if (IsPost && Request["block"] != null)
    {
               var blockQuery="update Report set IsBlock='1' where Sender='"+Request["block"]+"' AND SendedFor='"+Request["block2"]+"'"; 
       var delfriend = "delete from FriendRequest where (SenderUserID='" +           Request["block"] + "' AND RequestedUserID='" + Request["block1"] + "') AND IsActive='1'";
       var delfriend1 = "delete from FriendRequest where (SenderUserID='" + Request["block1"] + "' AND RequestedUserID='" + Request["block"] + "') AND IsActive='1'";  
       db.Query(blockQuery);
       db.Query(delfriend);
       db.Query(delfriend1);
       Blockmessage = "User Blocked"; 
}

    @foreach (var row in db.Query(selectReportquery))
             {
               <tr>
                 <td>@row.Sender</td>
                 <td>@row.SendedFor</td>
                 <td>@row.Description</td>
                 <td>
                 <form action="" method="post"> 
               <input type="hidden" name="block" value="@row.sender" />
               <input type="hidden" name="block2" value="@row.SendedFor" />
               <input type="submit" value="Block" class="button" />
                 </form>
                 </td>
                 </tr>
               }

Related posts

Recent Viewed