Click here to Skip to main content
15,891,316 members
Home / Discussions / C#
   

C#

 
GeneralRe: Continous events from a button click Pin
DavidNohejl12-Sep-07 0:52
DavidNohejl12-Sep-07 0:52 
GeneralRe: Continous events from a button click Pin
Brady Kelly11-Sep-07 21:56
Brady Kelly11-Sep-07 21:56 
AnswerRe: System.Xml.XmlException Pin
Sandeep Akhare11-Sep-07 20:28
Sandeep Akhare11-Sep-07 20:28 
GeneralRe: System.Xml.XmlException Pin
Malcolm Smart11-Sep-07 21:04
Malcolm Smart11-Sep-07 21:04 
QuestionComparing a Tableadapter to checkedlistbox items Pin
falles0111-Sep-07 19:10
falles0111-Sep-07 19:10 
AnswerRe: Comparing a Tableadapter to checkedlistbox items Pin
Malcolm Smart11-Sep-07 21:10
Malcolm Smart11-Sep-07 21:10 
GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
falles0111-Sep-07 21:19
falles0111-Sep-07 21:19 
GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
Malcolm Smart11-Sep-07 23:21
Malcolm Smart11-Sep-07 23:21 
I am assuming (hoping) that you create your CheckBoxList dynamically, and read the possible options from the db. When you do, you add the checks as ListItems. Something like
<br />
while (myreader.Read())<br />
{<br />
ListItem myCheckBoxItem = new ListItem( myreader["DESCRIPTION"].ToString() , myreader["ID"].ToString() );<br />
myCheckBoxList.Items.Add( myCheckBoxItem );<br />
}<br />


To select the relevant ones, read all the skills for a user from the database

<br />
sqlstring = "select skillID from userSkills where userID = 'myuser'";<br />
//populate a datatable with the result set<br />
<br />
DataRow[] rows = dt.Select();<br />
foreach(DataRow row in rows)<br />
{<br />
string techID = row["skillID"].ToString();<br />
myCheckBoxList.Items.FindByValue( techID ).Selected = true;<br />
}<br />

And that's it. Please excuse typos etc as I can't get to a dev box to test this.







"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF


"I haven't spoken to my wife now for 48 hours. I don't like to interrupt her.

GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
falles0112-Sep-07 14:27
falles0112-Sep-07 14:27 
GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
Malcolm Smart12-Sep-07 20:41
Malcolm Smart12-Sep-07 20:41 
GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
falles0112-Sep-07 20:46
falles0112-Sep-07 20:46 
GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
falles0112-Sep-07 21:35
falles0112-Sep-07 21:35 
GeneralRe: Comparing a Tableadapter to checkedlistbox items Pin
falles0113-Sep-07 15:36
falles0113-Sep-07 15:36 
QuestionC# Pin
ramyanaidu11-Sep-07 18:37
ramyanaidu11-Sep-07 18:37 
AnswerRe: C# Pin
Sathesh Sakthivel11-Sep-07 18:51
Sathesh Sakthivel11-Sep-07 18:51 
AnswerRe: C# Pin
I.explore.code11-Sep-07 19:09
I.explore.code11-Sep-07 19:09 
AnswerRe: C# Pin
Pete O'Hanlon11-Sep-07 22:17
mvePete O'Hanlon11-Sep-07 22:17 
QuestionHow to disable blinking cursor in my Form ? Pin
Yanshof11-Sep-07 18:10
Yanshof11-Sep-07 18:10 
AnswerRe: How to disable blinking cursor in my Form ? Pin
falles0111-Sep-07 19:23
falles0111-Sep-07 19:23 
AnswerRe: How to disable blinking cursor in my Form ? Pin
falles0111-Sep-07 19:51
falles0111-Sep-07 19:51 
GeneralRe: How to disable blinking cursor in my Form ? Pin
Yanshof11-Sep-07 19:55
Yanshof11-Sep-07 19:55 
QuestionC# accessing non.NET libraries Pin
zaiyatul hijah11-Sep-07 16:38
zaiyatul hijah11-Sep-07 16:38 
AnswerRe: C# accessing non.NET libraries Pin
Malcolm Smart11-Sep-07 20:58
Malcolm Smart11-Sep-07 20:58 
AnswerRe: C# accessing non.NET libraries Pin
WillemM11-Sep-07 21:04
WillemM11-Sep-07 21:04 
GeneralRe: C# accessing non.NET libraries Pin
zaiyatul hijah12-Sep-07 17:04
zaiyatul hijah12-Sep-07 17:04 

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.