allora ho fatto così
codice:
RequiredFieldValidator1.Enabled = True
RequiredFieldValidator2.Enabled = True
RequiredFieldValidator3.Enabled = True
RequiredFieldValidator4.Enabled = True
RequiredFieldValidator5.Enabled = True
RequiredFieldValidator6.Enabled = True
Dim sqlUpdate As String
Dim cn As New SqlClient.SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("CnString"))
sqlUpdate &= "Nome='" & txtNome.Text & "',"
sqlUpdate &= "Cognome='" & txtCognome.Text & "',"
sqlUpdate &= "Cognome='" & txtCognome.Text & "',"
sqlUpdate &= "Cognome='" & txtCognome.Text & "',"
sqlUpdate &= "Cognome='" & txtCognome.Text & "',"
If txtTelefono.Text.Length > 6 Then
sqlUpdate &= "TelefonoFisso='" & txtTelefono.Text & "',"
End If
If txtFax.Text.Length > 6 Then
sqlUpdate &= "Fax='" & txtFax.Text & "',"
End If
sqlUpdate &= "Mail='" & txtMail.Text & "',"
If txtCellulare.Text.Length > 6 Then
sqlUpdate &= "Cellulare='" & txtCellulare.Text & "',"
End If
If txtFiscale.Text.Length > 10 Then
sqlUpdate &= "CodFicale='" & txtFiscale.Text & "',"
End If
If txtIva.Text.Length > 10 Then
sqlUpdate &= "PIva='" & txtIva.Text & "',"
End If
If txtOldPass.Text <> "" Then
ValidatePass.Enabled = True
If txtNewPass1.Text.Length < 6 Then
lblMessage.Text = "La password deve essere di almeno 6 caratteri"
Exit Sub
Else
sqlUpdate &= "Pasw='" & txtNewPass1.Text & "',"
End If
End If
If DropNazione.SelectedValue <> "" Then
sqlUpdate &= "Nazione='" & DropNazione.SelectedValue.ToString & "',"
End If
If dropProvincia.SelectedValue <> "" Then
sqlUpdate &= "Provincia='" & dropProvincia.SelectedValue.ToString & "',"
End If
If txtIva.Text.Length < 10 Then
CodFiscPIva.Enabled = True
Else
CodFiscPIva.Enabled = False
End If
Dim cm As New SqlClient.SqlCommand
cm.CommandText = "UPDATE Utenti SET" & sqlUpdate & "WHERE Utente = '" & Session.Item("id") & "'"
cm.Connection = cn
cm.ExecuteNonQuery()
riempiCampi()
lblMessage.Text = "dati aggiornati con successo"
ma non và..cioè non dà errori ma non aggiorna na cippa