Hello,
I have below situation:
3 users (friends) registered initially as under:
SQL Table – M
Id UserId Password
1 A AXXX
2 B BXXX
3 C CXXX
When “A” logged in He was directed to a secure page with following UI in a gridview
UserId Comments
B TextBox – Required field
C TextBox – Required field
Save Button
“A” entered the comments for “B” & “C” and saved as under:
SQL Table - N
CId UserId ToUserId Comments
1 A B Comment1
2 A C Comment2
Meanwhile some more users registered and now Table “M” is like as under:
Id UserId Password
1 A AXXX
2 B BXXX
3 C CXXX
4 D DXXX
5 E EXXX
“B” also logs in and following similar UI, fills the comments for “A”, “C” and “D”.
SQL Table – N now looks like
CId UserId ToUserId Comments
1 A B Comment1
2 A C Comment2
3 B A Comment3
4 B C Comment4
5 B D Comment5
Now when “A” logs in, He SHOULD get below UI on his secure page gridview:
UserId Comments
D TextBox – Required field
E TextBox – Required field
Save Button
The idea is that each user has to write comments for every other users. Please advise the sql query that gets the above result or help me complete my sql statement as: “SELECT M.UserId FROM M INNER JOIN N ON N.UserId = M.UserId WHERE M.UserId IS NOT LIKE ‘”+ Label1.text +”’ AND ---------------------”
Thanks for your help. Sat