Click here to Skip to main content
15,890,186 members
Home / Discussions / C#
   

C#

 
GeneralRe: message count down counter Pin
troubled one3-Sep-07 15:32
troubled one3-Sep-07 15:32 
QuestionLoading Datasets Pin
MAW302-Sep-07 18:28
MAW302-Sep-07 18:28 
AnswerRe: Loading Datasets Pin
Syed Mujtaba Hassan2-Sep-07 20:02
Syed Mujtaba Hassan2-Sep-07 20:02 
GeneralRe: Loading Datasets Pin
MAW303-Sep-07 10:08
MAW303-Sep-07 10:08 
QuestionParametized queries in C#-Hard one. Pin
falles012-Sep-07 14:56
falles012-Sep-07 14:56 
AnswerRe: Parametized queries in C#-Hard one. Pin
Christian Graus2-Sep-07 15:12
protectorChristian Graus2-Sep-07 15:12 
AnswerRe: Parametized queries in C#-Hard one. Pin
Guffa2-Sep-07 19:15
Guffa2-Sep-07 19:15 
GeneralRe: Parametized queries in C#-Hard one. Pin
falles012-Sep-07 21:12
falles012-Sep-07 21:12 
Thank you, but I decided to just use my insert statement for now as that works.

My question now is how exactly do I get selected values of a checkedlist box and store it as ID numbers in the database. I had something like this which is obviously wrong. It works for the comboboxes but then I heard you need for loops to check multiple selections in a checkedlistbox. Feel free to just change my code.

if (this.techSkillsCheckListBox2.CheckedItems.Count > 0)
{
label1.Text = "worked";
Confused | :confused:

foreach (string item in this.techSkillsCheckListBox2.CheckedItems)
{

string sql = "INSERT INTO employees(Firstname,Lastname,RoleID,DivisionID,ManagerID,TechnicalSkillsID) Values ('" + FirstnameText.Text.ToString() + "' , '" + Lastnametext.Text.ToString() + "' , " + RolecomboBoxTest.SelectedValue.ToString() + "," + DivisioncomboBox2.SelectedValue.ToString() + " , " + ManagercomboBox1.SelectedValue.ToString() + " , " + techSkillsCheckListBox2.SelectedValue.ToString() + ")";

Don't worry this won't be used commercially so I was told not to worry about injection attacks until I can get these correct.



Thank you for helping out.

AnswerRe: Parametized queries in C#-Hard one. Pin
Guffa2-Sep-07 21:47
Guffa2-Sep-07 21:47 
GeneralRe: Parametized queries in C#-Hard one. Pin
falles012-Sep-07 21:56
falles012-Sep-07 21:56 
Questioniterate through properties [modified] Pin
ushering2-Sep-07 12:27
ushering2-Sep-07 12:27 
AnswerRe: iterate through properties Pin
Colin Angus Mackay2-Sep-07 12:56
Colin Angus Mackay2-Sep-07 12:56 
Questiondelete Pin
Assaf822-Sep-07 10:40
Assaf822-Sep-07 10:40 
AnswerRe: delete Pin
Paul Conrad2-Sep-07 11:01
professionalPaul Conrad2-Sep-07 11:01 
AnswerRe: delete Pin
Christian Graus2-Sep-07 11:06
protectorChristian Graus2-Sep-07 11:06 
GeneralRe: delete Pin
Assaf822-Sep-07 11:32
Assaf822-Sep-07 11:32 
GeneralRe: delete Pin
Christian Graus2-Sep-07 11:38
protectorChristian Graus2-Sep-07 11:38 
QuestionTessellations Pin
spelltwister2-Sep-07 10:34
spelltwister2-Sep-07 10:34 
AnswerRe: Tessellations Pin
Mark Churchill2-Sep-07 19:00
Mark Churchill2-Sep-07 19:00 
GeneralRe: Tessellations Pin
spelltwister2-Sep-07 19:50
spelltwister2-Sep-07 19:50 
GeneralRe: Tessellations Pin
Mark Churchill2-Sep-07 21:12
Mark Churchill2-Sep-07 21:12 
Questionaccess violation Pin
Opa Knack2-Sep-07 9:19
Opa Knack2-Sep-07 9:19 
AnswerRe: access violation Pin
Christian Graus2-Sep-07 9:31
protectorChristian Graus2-Sep-07 9:31 
GeneralRe: access violation Pin
Opa Knack2-Sep-07 10:47
Opa Knack2-Sep-07 10:47 
GeneralRe: access violation Pin
Christian Graus2-Sep-07 11:10
protectorChristian Graus2-Sep-07 11:10 

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.