Click here to Skip to main content
15,900,616 members
Home / Discussions / Database
   

Database

 
GeneralRe: Further Help with Select Required Please Pin
djhankypark23-Nov-10 12:13
djhankypark23-Nov-10 12:13 
GeneralRe: Further Help with Select Required Please Pin
Luc Pattyn23-Nov-10 12:32
sitebuilderLuc Pattyn23-Nov-10 12:32 
GeneralRe: Further Help with Select Required Please Pin
djhankypark23-Nov-10 13:01
djhankypark23-Nov-10 13:01 
GeneralRe: Further Help with Select Required Please [modified] Pin
Luc Pattyn23-Nov-10 13:16
sitebuilderLuc Pattyn23-Nov-10 13:16 
GeneralRe: Further Help with Select Required Please Pin
djhankypark23-Nov-10 13:33
djhankypark23-Nov-10 13:33 
GeneralRe: Further Help with Select Required Please Pin
Luc Pattyn23-Nov-10 13:37
sitebuilderLuc Pattyn23-Nov-10 13:37 
GeneralRe: Further Help with Select Required Please Pin
djhankypark23-Nov-10 14:17
djhankypark23-Nov-10 14:17 
AnswerRe: Further Help with Select Required Please Pin
Luc Pattyn23-Nov-10 14:15
sitebuilderLuc Pattyn23-Nov-10 14:15 
I think I got it now. I printed your specs, changed the notation, and came to the following spec for you to accept/reject:

person X wants to see all messages from F to T where X is buddy of author F (where buddyship is one-way and excludes oneself). Therefore Eric wants to see what Dave sent (Dave is his only buddy), and Lacey wants to see all except her own outgoing messages (she is buddy with all three others).

Assuming that is what you want, the code would resemble this:

...
JOIN buddylist AS BUD ON FU.id = BUD.author_ID
WHERE TU.active=1 AND BUD.buddy_ID = @ME


you need to get the ID of the querying person where it says @ME. There basically are two ways:
1. the string approach, just stuff the immediate value in the SQL statement
2. the parameterized approach, use SqlCommand with SqlParameter (could also apply with a stored procedure)

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Further Help with Select Required Please Pin
djhankypark23-Nov-10 14:24
djhankypark23-Nov-10 14:24 
GeneralRe: Further Help with Select Required Please Pin
Luc Pattyn23-Nov-10 14:48
sitebuilderLuc Pattyn23-Nov-10 14:48 
QuestionDatabase design Pin
digicd123-Nov-10 7:31
digicd123-Nov-10 7:31 
AnswerRe: Database design Pin
fjdiewornncalwe23-Nov-10 7:51
professionalfjdiewornncalwe23-Nov-10 7:51 
AnswerRe: Database design Pin
Eddy Vluggen23-Nov-10 7:54
professionalEddy Vluggen23-Nov-10 7:54 
GeneralRe: Database design Pin
digicd123-Nov-10 8:04
digicd123-Nov-10 8:04 
GeneralRe: Database design Pin
Eddy Vluggen23-Nov-10 8:33
professionalEddy Vluggen23-Nov-10 8:33 
GeneralRe: Database design Pin
digicd124-Nov-10 3:38
digicd124-Nov-10 3:38 
GeneralRe: Database design Pin
Eddy Vluggen24-Nov-10 7:20
professionalEddy Vluggen24-Nov-10 7:20 
AnswerRe: Database design Pin
Mycroft Holmes23-Nov-10 19:13
professionalMycroft Holmes23-Nov-10 19:13 
Questionparam_record_id int OUTPUT Pin
Jassim Rahma23-Nov-10 4:01
Jassim Rahma23-Nov-10 4:01 
AnswerRe: param_record_id int OUTPUT Pin
Eddy Vluggen23-Nov-10 7:31
professionalEddy Vluggen23-Nov-10 7:31 
Questionmultiple select statements in stored procedures Pin
Xiangyang Liu 刘向阳23-Nov-10 2:17
Xiangyang Liu 刘向阳23-Nov-10 2:17 
AnswerRe: multiple select statements in stored procedures Pin
Pete O'Hanlon23-Nov-10 2:21
mvePete O'Hanlon23-Nov-10 2:21 
GeneralRe: multiple select statements in stored procedures Pin
Xiangyang Liu 刘向阳23-Nov-10 3:19
Xiangyang Liu 刘向阳23-Nov-10 3:19 
AnswerRe: multiple select statements in stored procedures Pin
Jörgen Andersson23-Nov-10 2:47
professionalJörgen Andersson23-Nov-10 2:47 
GeneralRe: multiple select statements in stored procedures Pin
Xiangyang Liu 刘向阳24-Nov-10 0:46
Xiangyang Liu 刘向阳24-Nov-10 0:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.