ciao
non ho capito perchè utilizzando questo codice mi vengono pescati anche i rangevalidator come se fossero delle textbox
Dim C As Control
For Each C In Panel1.Controls
If TypeOf C Is TextBox Then
If UCase(Mid(C.ID, 4, 1)) <> "N" Then
sql += CType(C, TextBox).ID & "='" & CType(C, TextBox).Text.Replace("'", "''") & "', "
Else
sql += CType(C, TextBox).ID & "=" & CType(C, TextBox).Text.Replace("'", "''").Replace(",", ".") & ", "
End If
End If
If TypeOf C Is Label Then
sql += CType(C, Label).ID & "='" & CType(C, Label).Text.Replace("'", "''") & "', "
End If
If TypeOf C Is DropDownList Then
sql += CType(C, DropDownList).ID & "='" & CType(C, DropDownList).SelectedItem.Text & "', "
End If
Next
