I'm developing a social networking site where i'm facing problem when sending Friend Request from one user to another....The problem is that FriendRequest shows `` to every user not only to whom it send so i want to show that request to whom it send e.g: A send request to B so only B can see that request on FriendRequests.aspx just like facebook
I have these two pages
- People.aspx ...
- FriendRequests.aspx
Database table : FriendRequest.dbo
In People.aspx.....Subsonic Tool used...
FriendRequest obj = new FriendRequest();
obj.IsNew = true;
obj.Uid = Convert.ToInt32(Session["UserID"]);
obj.IsFriend = false;
obj.Save();
In FriendRequets.aspx
if (!IsPostBack)
{
if (Session["UserID"] != null)
{
Response.Write(Session["FID"].ToString());
DataTable dt = Helper.ExecutePlainQuery("select * from UserRegistration inner join Profile on UserRegistration.uid=Profile.uid inner join FriendRequest on UserRegistration.uid=FriendRequest.uid");
repeater1.DataSource = dt;
repeater1.DataBind();
}
In database table FriendRequest.dbo
ReqID int primary
uid int Foreign
isFriend bit
The design of these two pages just looks like facebook "People you may know" page and "Friend Requests" page
Your query should looke like this:
by using
WHEREyou are filtering the result to only the ones where theReqIDmatched the logged in user. On the assumption thatReqIDis the personuidwants to be friends with.