PDA

View Full Version : Having problem with Checkbox list.


hari.rao
08-28-2007, 05:56 AM
Hi guys, Im new here. Anyway, im having this problem of inserting multiple string of data into the same table. I am using <asp:checkboxlist> and the items from the check box is dynamically genarated. Below is the code that i am using to split the checkbox, and i am not able to read the checkbox.

Anybody out there,... pls help me if you have experienced it before.. thanks mate.


Dim MyArray = Split(Request.Params("checkBusinessType"),",")
Dim i
For i=0 to UBound(MyArray)

strSql = "INSERT INTO TBLUSER_MANAGEMENT (SYSTEM_OWNERS, SYSTEMID) "
strSql += "VALUES ('"& trim(txtEmail.Text) &"','"& MyArray(i) &"');"
response.write(strSql)
Dim cmdJob3 As OleDbCommand

nikkiH
08-28-2007, 04:27 PM
Aren't you posting back the page?
This looks like old ASP code, not the .NET way of doing things. You should not need to use Request.Params for this. You should be able to enumerate your checkboxlist. Is it not being saved in the viewstate because of the way you're generating it? Was there a reason not to databind so that it would be saved?

That said, if you need to use the request object this way, just use Request("checkBusinessType") instead of Request.Params. If that doesn't work, post what does happen, like if you get an error. It isn't clear what exactly is not working.