Article View: free.it.visual-basic
Article #636Modifica con ado.net
From: Massimo
Date: Tue, 21 Feb 2006 17:34
Date: Tue, 21 Feb 2006 17:34
39 lines
2356 bytes
2356 bytes
Vorrei salvare le modifiche apportate in un campo del record con ado.net.
in vb6 facevo cos�:
rs("Cognome")="Rossi"
rs.update
e il gioco era fatto
ora � un macello, non si capisce niente, ho provato queste due soluzioni, ma
nessuna funziona:
-------------------------------------------------------------------
1� prova:
Dim cmdBuild As New OleDbCommandBuilder(da2)
Me.tblVideoteca.Rows(x)("Titolo") = Me.Titolo.Text
Me.da2.Update(ds.Tables("QueryVideoteca"))
Me.da2.UpdateCommand = cmdBuild.GetDeleteCommand()
Me.da2.DeleteCommand = cmdBuild.GetDeleteCommand()
MsgBox(da2.Update(ds, "QueryVideoteca"))
ds.AcceptChanges()
------------------------------------------------------------------------
2� Prova:
Dim myrow As DataRow = Me.tblVideoteca.Rows(x)
myrow.BeginEdit()
myrow("Titolo") = Me.Titolo.Text
myrow.AcceptChanges()
Me.tblVideoteca.AcceptChanges()
Me.ds.AcceptChanges()
Me.da2.Update(myrow("Titolo") = Me.Titolo.Text)
------------------------------------------------------------------------
ho realizzato un bel progetto, ma mi manca solo questo cavolo di
aggiornamento che non riesco in nessuna maniera. se qualcuno riesce a dare
un'occhiata al mio codice e dirmi dove sto sbagliando gliene sarei grato,
magari effettuandomi le correzioni necessarie. grazie e ciao
Technical Details
Message-ID:
<43fb4f29$0$28060$4fafbaef@reader1.news.tin.it>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!news2.volia.net!feeder.news.tin.it!spool.news.tin.it!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f94ee,9c89ca02611e9d32,start X-Google-Attributes: gidf94ee,public X-Google-Language: ITALIAN,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!news2.volia.net!feeder.news.tin.it!spool.news.tin.it!not-for-mail From: "Massimo" <nospam@nospam.it> Newsgroups: free.it.visual-basic Subject: Modifica con ado.net Date: Tue, 21 Feb 2006 18:34:35 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Antivirus: avast! (VPS 0608-0, 20/02/2006), Outbound message X-Antivirus-Status: Clean Lines: 42 Message-ID: <43fb4f29$0$28060$4fafbaef@reader1.news.tin.it> Organization: TIN.IT (http://www.tin.it) X-Comments: Please send technical notifications to newsmaster@tin.it NNTP-Posting-Host: 87.6.243.97 X-Trace: 1140543274 reader1.news.tin.it 28060 87.6.243.97:1087 X-Complaints-To: Please send abuse reports to abuse@tin.it