PsychoCoder
Programmer
I have a webform when I create dynamic textboxes depending on how many times the user clicks the "Add" link. When they hit the "Submit" button Im trying to loop through the dynamic textboxes and insert the information into the database.
Im trying to do this inside a loop (as Im sure thats the only way to do it since they were created in a loop and the only difference in the name is the counter number.
I have this loop:
The line in bold is giving me the problem, I cant seem to use the name of the textbox object_ and concat the counter value to it (ie; object_1, object_2, etc..).
Does anyone have any ideas on how I can do this?
Senior Qik III,.Net,SQL Programmer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** Do NOT feed Code Gremlins after midnight **
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Im trying to do this inside a loop (as Im sure thats the only way to do it since they were created in a loop and the only difference in the name is the counter number.
I have this loop:
Code:
For iCount = 0 To Session("NetTextBoxCount")
sSQL = "INSERT INTO "
sSQL &= "dbo.Turbo_Change_Log_Items(change_log_id,change_object, change_object_changes, change_object_type, date_entered)"
sSQL &= "SELECT"
sSQL &= "@change_log_id,@change_object,@change_object_changes,1,GETDATE()"
Command = New SqlCommand(sSQL, Connection)
Command.Parameters.AddWithValue("@change_log_id", CType(NewId, Integer))
Command.Parameters.AddWithValue("@change_object", [b]FindControl(object_ & iCount)[/b])
Next
The line in bold is giving me the problem, I cant seem to use the name of the textbox object_ and concat the counter value to it (ie; object_1, object_2, etc..).
Does anyone have any ideas on how I can do this?
Senior Qik III,.Net,SQL Programmer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** Do NOT feed Code Gremlins after midnight **
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~