Devo fare l'aggiornamento di una tabella ( tblInterventi ) così strutturata:
Campo Chiave Cod_Inter ( contatore )
Id_Sotto
Num_Comm
Codice
Nome_Inter
Data_Inter
Ore_Inter
Ed ho questa procedura associata all'evento Click di un bottone ( btnUpdate ):
Fa tutto, mi stampa anche il contenuto della Label ( lblOk ), ma non mi fa l'aggiornamento nel DataBase.codice:Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Dim connessione As String Dim conn As OleDbConnection Dim cmdUpdate As OleDbCommand Dim strUpdate As String connessione = ConfigurationSettings.AppSettings("conString") conn = New OleDbConnection(connessione) conn.Open() strUpdate = "Update tblInterventi Set tblInterventi.Id_Sotto=@under, tblInterventi.Num_Comm=@comm, tblInterventi.Codice=@persona, tblInterventi.Nome_Inter=@intername, tblInterventi.Data_Inter=@day, tblInterventi.Ore_Inter=@hours Where tblInterventi.Cod_Inter=@code" cmdUpdate = New OleDbCommand(strUpdate, conn) cmdUpdate.Parameters.Add("@code", txtCodice.Text) cmdUpdate.Parameters.Add("@under", DropDownList1.SelectedItem.Value) cmdUpdate.Parameters.Add("@comm", DropDownList2.SelectedItem.Value) cmdUpdate.Parameters.Add("@persona", txtPersona.Text) cmdUpdate.Parameters.Add("@intername", txtNome.Text) cmdUpdate.Parameters.Add("@day", txtDay.Text) cmdUpdate.Parameters.Add("@hours", txtHours.Text) cmdUpdate.ExecuteNonQuery() conn.Close() lblOK.Text = "AGGIORNAMENTO EFFETTUATO!" lblOK.Visible = True End Sub
Come mai?![]()
![]()
![]()
Grazie per l'aiuto
![]()
Beke

  
 
					
					
					
						
  Rispondi quotando