You did not explain what are you trying to do, or what's the target SQL.
As far as I undertand from the code, you want to delete a friend relationship between 2 members.
So you have 2 GUIDs and you want to delete any records in a Friend table that associate these GUIDs with each other.
All you have to do is to implement the following SQL:
DELETE FROM Friend
WHERE
(MemberGuid = memberGUID AND FriendGuid == friendGUID)
OR
(MemberGuid = friendGUID AND FriendGuid == memberGUID)
I'll leave the rest for you.
Hints:
- You don't need to fetch anything to execute the delete command.
- You don't need to open and close connections, these are done automatically.
- The connection can be kept open to execute multiple commands, this can be done by passing true to the DataAccessAdapter Ctor.