Salve a tutti e la prima volta che scrivo in un forum quindi non fate caso se il messaggio non è chiaro del tutto.
A da un paio di mesi che provo a studiare ASP.NET 2un grandissimo casino, cmq ho un problema con questa striga:
<script runat="server">
Sub Page_Load(Obj as Object, E as EventArgs)
'CREIAMO LA CONNESSIONE
Dim CONNESSIONE as New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = D:\Inetpub\wwwroot\sitoflaccessori\database\magazz ino.mdb")
'CREA DATASET E OLEDBDATAADAPTER
Dim DS as New DataSet("MIODATASET")
Dim OGGCOMDA as New OleDbDataAdapter("SELECT * From articoli WHERE IDarticolo < 10", CONNESSIONE)
'RIEMPIAMO DATASET
OGGCOMDA.fill(DS, "articoli")
'EFFETTUIAMO ALCUNE MODIFICHE SUI DATI
DS.Tables("articoli").Rows(2)(3) = "ASPVille"
Dim DR as DataRow = DS.Tables("articoli").NewRow()
DR(1) = "Massimo"
DR(2) = "sta provando"
DR(3) = "a modificare"
DR(4) = "alcuni"
DR(5) = "dati"
'DR(6) = "del Database"
DS.Tables("articoli").Rows.Add(DR)
'FORNIAMO UN COMANDO SQL E ATTIVIAMO LA CONNESSIONE
OGGCOMDA.UpDateCommand = New OleDbCommand
OGGCOMDA.UpDateCommand.CommandText = "Update articoli" & "Set marcaART = 'MASSIMO' WHERE IDarticolo = 3"
OGGCOMDA.UpDateCommand.Connection = CONNESSIONE
'FORNIAMO UN COMANDO SQL E ATTIVIAMO LA CONNESSIONE
OGGCOMDA.InsertCommand = New OleDbCommand
OGGCOMDA.InsertCommand.CommandText = "Insert INTO" & "articoli (marcaART, categoriaART, " & _
"descrizioneART, codiceART, corispART, dispART) VALUES ('Massimo', 'sta provando', " & _
"'a modificare', 'alcuni', 'dati', 'del database'"
OGGCOMDA.InsertCommand.Connection = CONNESSIONE
OGGCOMDA.Update(DS, "articoli")
End Sub
</script>
sto usando l'oggetto OleDbDataAdapter e le relative istruzioni UpDate e insert.
Ma quando eseguo il codice mi da l'errore
Errore di sintassi nell'istruzione UPDATE![]()
![]()
ma che vuole direeeeeeeee!!!!!
Io per non sbagliare il codice lo messo tutto spero possiate aiutarmi