Click here to Skip to main content
15,913,773 members
Home / Discussions / Database
   

Database

 
GeneralRe: Select records from a single table that have common data in two columns Pin
Johan Hakkesteegt14-Jun-11 21:26
Johan Hakkesteegt14-Jun-11 21:26 
AnswerRe: Select records from a single table that have common data in two columns Pin
Eddy Vluggen14-Jun-11 1:10
professionalEddy Vluggen14-Jun-11 1:10 
GeneralRe: Select records from a single table that have common data in two columns Pin
Mycroft Holmes14-Jun-11 1:22
professionalMycroft Holmes14-Jun-11 1:22 
AnswerRe: Select records from a single table that have common data in two columns Pin
Eddy Vluggen14-Jun-11 1:29
professionalEddy Vluggen14-Jun-11 1:29 
GeneralRe: Select records from a single table that have common data in two columns Pin
GenJerDan14-Jun-11 4:05
GenJerDan14-Jun-11 4:05 
AnswerRe: Select records from a single table that have common data in two columns Pin
Eddy Vluggen14-Jun-11 4:12
professionalEddy Vluggen14-Jun-11 4:12 
GeneralRe: Select records from a single table that have common data in two columns Pin
GenJerDan14-Jun-11 4:29
GenJerDan14-Jun-11 4:29 
AnswerRe: Select records from a single table that have common data in two columns Pin
Eddy Vluggen14-Jun-11 4:44
professionalEddy Vluggen14-Jun-11 4:44 
GeneralRe: Select records from a single table that have common data in two columns Pin
GenJerDan14-Jun-11 4:58
GenJerDan14-Jun-11 4:58 
AnswerRe: Select records from a single table that have common data in two columns Pin
Eddy Vluggen14-Jun-11 5:20
professionalEddy Vluggen14-Jun-11 5:20 
GeneralRe: Select records from a single table that have common data in two columns Pin
GenJerDan14-Jun-11 5:34
GenJerDan14-Jun-11 5:34 
AnswerRe: Select records from a single table that have common data in two columns Pin
Eddy Vluggen14-Jun-11 7:07
professionalEddy Vluggen14-Jun-11 7:07 
AnswerRe: Select records from a single table that have common data in two columns Pin
Mycroft Holmes14-Jun-11 1:25
professionalMycroft Holmes14-Jun-11 1:25 
GeneralRe: Select records from a single table that have common data in two columns Pin
_Damian S_14-Jun-11 14:55
professional_Damian S_14-Jun-11 14:55 
GeneralRe: Select records from a single table that have common data in two columns Pin
Mycroft Holmes14-Jun-11 19:53
professionalMycroft Holmes14-Jun-11 19:53 
Questionchecking the fieldname in the table Pin
Dhyanga13-Jun-11 9:42
Dhyanga13-Jun-11 9:42 
AnswerRe: checking the fieldname in the table Pin
PIEBALDconsult13-Jun-11 14:48
mvePIEBALDconsult13-Jun-11 14:48 
AnswerRe: checking the fieldname in the table Pin
Mohamad Kaifi13-Jun-11 23:53
Mohamad Kaifi13-Jun-11 23:53 
GeneralRe: checking the fieldname in the table Pin
PIEBALDconsult14-Jun-11 2:53
mvePIEBALDconsult14-Jun-11 2:53 
GeneralRe: checking the fieldname in the table Pin
Dhyanga14-Jun-11 3:10
Dhyanga14-Jun-11 3:10 
AnswerRe: checking the fieldname in the table Pin
Simon_Whale14-Jun-11 3:04
Simon_Whale14-Jun-11 3:04 
GeneralRe: checking the fieldname in the table Pin
Dhyanga14-Jun-11 3:12
Dhyanga14-Jun-11 3:12 
QuestionComparing Table Entries Using C# and MS Access Pin
VonHagNDaz13-Jun-11 8:16
VonHagNDaz13-Jun-11 8:16 
Hey Guys,

Saying I'm a rookie at databases would be giving me too much credit. That said, I'm working on a project where a manager can create a job for his employees. Each employee is stored in a table tblUsers and each job is stored in a table tblJobs. Now I know I have a few problems with the way my DB is set up. tblUsers has a primary key of UserName and tblJobs has a primary key of Job Descriptions. Each entry in tblJobs has a linked key, UserName from tblUsers is linked to Project lead from tblJobs.

I have two ArrayLists, jobs and copyOfJobs. When a manager signs in, copyOfJobs is passed to what I call ManagerForm. In ManagerForm, the manager can make alterations to copyOfJobs, and once he exits, I want to compare jobs with copyOfJobs. The contents of jobs is pulled from an Access Database, then copied to copyOfJobs. Once ManagerForm is closed, I want to compare jobs to copyOfJobs. Durring the comparison I want to check if things such as project name, project lead, duedate for a particular assignment has changed. If changed, I want it removed from the database and reinserted with the new values. I'm completely stuck! Any advice/comments would be greatly appreciated.

Here is some code to prove I've actually messed around with this before coming to you guys.

public void GetUsers(ArrayList users)
{
    object[] userData = new object[4];

    OleDbCommand dbCommand = new OleDbCommand("SELECT * FROM tblUsers", this._dbConnection);

    try
    {
        OleDbDataReader dbReader = dbCommand.ExecuteReader();

        while (dbReader.Read())
        {
            User currentUser = new User();
            dbReader.GetValues(userData);

            //get user name
            currentUser.Name = userData[0].ToString();
            //get password
            currentUser.Password = userData[1].ToString();
            //get rights
            string temp = userData[2].ToString();
            int rights = Convert.ToInt16(temp);
            currentUser.Rights = (User.EN_RIGHTS)rights;
            //get jobs
            //still thinking about this one


            users.Add(currentUser);
        }
        dbReader.Close();
    }
    catch (Exception e)
    {
        String temp = String.Format("DBManager::GetUsers: {0}", e.Message);
        MessageBox.Show(temp);
    }
}

pretty simple, probably not the best way.

and here is the method stub that I'm working on so far
public void UpdateJobs(ArrayList copyOfJobs, ArrayList originalJobs)
{
    ArrayList copy = new ArrayList();
    ArrayList original = new ArrayList();

    copy = copyOfJobs;
    original = originalJobs;

    string temp = "";

    if (!copy.Equals(original))
    {
        temp = string.Format("");

        for (int i = 0; i < copyOfJobs.Count; i++)
        {

        }
    }
}

[Insert Witty Sig Here]

AnswerRe: Comparing Table Entries Using C# and MS Access Pin
Johan Hakkesteegt27-Jun-11 0:06
Johan Hakkesteegt27-Jun-11 0:06 
QuestionHow to remove column "rowguid" from table in SQL server 2008? Pin
Hy Chanhan13-Jun-11 5:53
professionalHy Chanhan13-Jun-11 5:53 

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.