Click here to Skip to main content
15,899,024 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to track an user with in an application Pin
rah_sin6-Sep-07 18:39
professionalrah_sin6-Sep-07 18:39 
GeneralRe: how to track an user with in an application Pin
prasadbuddhika7-Sep-07 0:10
prasadbuddhika7-Sep-07 0:10 
QuestionHow to get FTP Server's directory name. Pin
G.I Cho6-Sep-07 16:23
G.I Cho6-Sep-07 16:23 
AnswerRe: How to get FTP Server's directory name. Pin
ChrisKo7-Sep-07 11:42
ChrisKo7-Sep-07 11:42 
QuestionSetting checkedlist box from sql querie Pin
falles016-Sep-07 14:17
falles016-Sep-07 14:17 
AnswerRe: Setting checkedlist box from sql querie Pin
Larantz6-Sep-07 20:29
Larantz6-Sep-07 20:29 
GeneralRe: Setting checkedlist box from sql querie Pin
falles0110-Sep-07 13:33
falles0110-Sep-07 13:33 
GeneralRe: Setting checkedlist box from sql querie Pin
Larantz12-Sep-07 11:03
Larantz12-Sep-07 11:03 
First of all you should decide whether you want the TechnicalSkillsID as a column in the employees table - as you have now. If you keep it that way, and you want one empolyee to be able to own several TechnicalSkills, you'll have to store several ID's with a separating value.

A better approach, if you ask me, would be to remove the TechnicalSkillsID column from the employee table entirely, and rather create a TechnicalSkills table which uses the employeeID as a keyvalue. Then add one boolean column per technical skill that you want available.

You could then use the column name as a the name of the CheckedListBoxItem and set the Checked property according to the value from the database.

I'll write an example of the latter one:
Create a query for retrieving the row from the TechnicalSkill table with a employeeID equal to the employee you want to configure skills for.
Code for propagating and setting the value for CheckedListBoxItems:

... generate and execute the query for returning the techskills for the given employee
DataTable techSkillsTable = myDataSet.Tables[0];

//Query should return only one row, but we'll go with a foreach
foreach(DataRow row in techSkillsTable.Rows)
{
    foreach (DataColumn column in techSkillsTable.Columns)
    {
        string techSkillName = column.ColumnName;
        bool userHasSkill = false;

        try
        {
            userHasSkill = Convert.ToBoolean(row[column]);
        }
        catch
        {
            //Do nothing here as userHasSkill is initialized to false.
        }

        techSkillsListBox.Items.Add(techSkillName, userHasSkill);
    }
}


Hope it can be of some help.
Best regards!

-Larantz-



for those about to code, we salute you
http://www.itverket.no

Please refer to the Forum Guidelines for appropriate posting.

QuestionStrange Oracle error after migration Pin
Muammar©6-Sep-07 12:27
Muammar©6-Sep-07 12:27 
AnswerRe: how to check whether the data allready exists in the sqlserver database Pin
Pete O'Hanlon6-Sep-07 11:46
mvePete O'Hanlon6-Sep-07 11:46 
GeneralRe: how to check whether the data allready exists in the sqlserver database Pin
Larantz6-Sep-07 12:23
Larantz6-Sep-07 12:23 
GeneralRe: how to check whether the data allready exists in the sqlserver database Pin
Pete O'Hanlon6-Sep-07 21:58
mvePete O'Hanlon6-Sep-07 21:58 
QuestionImage manipulation application [modified] Pin
DanB19836-Sep-07 10:08
DanB19836-Sep-07 10:08 
AnswerRe: Image manipulation application Pin
Christian Graus6-Sep-07 10:12
protectorChristian Graus6-Sep-07 10:12 
AnswerRe: Image manipulation application Pin
Christian Graus6-Sep-07 10:18
protectorChristian Graus6-Sep-07 10:18 
GeneralRe: Image manipulation application Pin
DanB19836-Sep-07 10:19
DanB19836-Sep-07 10:19 
Questiondata from sqlserver into textboxes Pin
NewToAspDotNet6-Sep-07 10:03
NewToAspDotNet6-Sep-07 10:03 
AnswerRe: data from sqlserver into textboxes Pin
Larantz6-Sep-07 10:09
Larantz6-Sep-07 10:09 
GeneralRe: data from sqlserver into textboxes [modified] Pin
Larantz6-Sep-07 12:13
Larantz6-Sep-07 12:13 
GeneralRe: data from sqlserver into textboxes Pin
NewToAspDotNet9-Sep-07 9:43
NewToAspDotNet9-Sep-07 9:43 
AnswerRe: data from sqlserver into textboxes Pin
Spacix One6-Sep-07 10:39
Spacix One6-Sep-07 10:39 
QuestionDynamic Load WebControl Pin
pandacad6-Sep-07 10:02
pandacad6-Sep-07 10:02 
QuestionContext Menu with TextBox Filter Pin
doubleas23806-Sep-07 9:58
doubleas23806-Sep-07 9:58 
Questionpopups from webbrowser control Pin
Opa Knack6-Sep-07 9:54
Opa Knack6-Sep-07 9:54 
AnswerRe: popups from webbrowser control Pin
Spacix One6-Sep-07 10:47
Spacix One6-Sep-07 10:47 

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.