Tuesday, February 14, 2012

CheckBoxList in Database

Hello all. When using a checkboxlist, is each selection under the checkboxlist suppose to have it's own column in the database?

Thank you,
MikeHi Michael,
You could have it in one column and use a string with a delimiter between each of the checked values.
P|||Cool, thank you. Am I suppose to use a filter to check for specific values?

Mike|||Mike
You would use the split() function to get the values.

chkBoxArr = Split(yourString, ",")

For iCounter = 0 to Ubound(chkBoxArr )
Response.Write chkBoxArr (iCounter) & "<br>"
Next

The split returns an array, so you need to use something like the above to get the values.

Hope this helps|||Check out this link, it has a good split() function for SQL 2000
http://weblogs.asp.net/pleloup/archive/2003/04/14/5569.aspx
Pete|||Thank you. I'll check out the link.

Mike :)

No comments:

Post a Comment