Click here to Skip to main content
12,691,231 members (30,708 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
The informations are stored in diff tables of a database. For instance DB name say DB1. It has tables such as task,story,person,... I want to check the condition as if task.acceptor_id and story.owner_id=person.userId, then name of the task and story should be displayed in the particular user's page.
I also want to display the details of the tasks/story for a user/dev in a project website checking the condition that the user/developer is only assigned to any task/story of the project. Or it should not be display any tasks/story related information in his/her page.
should be done in C#
Please help me to finish it.
Thanks in advance...
Posted 24-Dec-12 0:01am
Sampath Kumar Sathiya 24-Dec-12 5:05am
Have you tried anything, Please give those details?
Zoltán Zörgő 24-Dec-12 5:29am
This is not a "quick answers" kind of question. Much like a whole project. Nobody will be able or willing to do the job for you. You have to try to solve by yourself, and if you get lost somewhere, and you have a really concrete question in a really concrete situation, you can come back, and we will be willing to help you - and most likely able to help you if it is possible.
You have not even specified if you want to make a thick (windows forms) or thin ( application...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try using an SQL JOIN:
SELECT t.Name, s.Name FROM person p
JOIN story s ON p.userId=s.owner_id
JOIN task t ON p.userId=t.acceptor_id
All you have to do is package it in C# code:
using (SqlConnection con = new SqlConnection(strConnect))
    using (SqlCommand com = new SqlCommand("SELECT t.Name AS task, s.Name AS story FROM person p JOIN story s ON p.userId=s.owner_id JOIN task t ON p.userId=t.acceptor_id", con))
        using (SqlDataReader reader = com.ExecuteReader())
            while (reader.Read())
                string task = (string) reader["task"];
                string story = (string) reader["story"];
                Console.WriteLine("{0}, {1}", task, story);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170117.1 | Last Updated 24 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100