Ciao riesumo il post perchè ho un problema con lostesso script dello stesso libro.
Ho utilizzato lo script com'è e funziona, ho provato poi a cambiare la tabella con una mia per fare delle prove e funziona tutto tranne l'UPDATE
ila tabella si chiama news e ci sono tre campi: id, news e data.
Ho mmodificato lo script così:
function UpdateDatastore(e as datagridcommandeventargs)
dim i,j as integer
dim params(2) as string
dim strtext as string
dim blngo as boolean=true
j=0
for i=1 to e.item.cells.count -3
strtext = ctype(e.item.cells(i).controls(0), _
textbox).text
if strtext <> "" then
params(j)=strtext
j=j+1
else
blngo=false
lblmessage.text=lblmessage.text & _
"you forgot to enter a value
"
end if
next
if not blnGo then
return false
exit function
end if
dim strSQL as string = "UPDATE tblUsers SET " & _
"news = '" & params(0) & "'," & _
"data = '" & params(1) & "'," & _
"where userId=" & Ctype (e.Item.Cells(0). _
Controls(1), Label).text
ExecuteStatement(strSQL)
return blnGo
end function
ma il database non viene aggiornato.
Ho letto tutta la storia che quando la cella è 0 l'array è 1 ecc ma non riesco a risolvere.
Cosa sbaglio??
ciao e scusate l'ignoranza...