Data adapter eseguire l'update di un datase

lunedì 24 luglio 2006 - 16.22

andreapavia Profilo | Senior Member

ho pravato a fare l'udate di un dataset letto e poi modificato e funziona correttamente

' Declarations:
Dim da As OdbcDataAdapter
Dim ConnStr As String = ""

' Load:
da = New OdbcDataAdapter("SELECT * FROM Customers", ConnStr)
Dim cb As New OdbcCommandBuilder(da)
da.InsertCommand = cb.GetInsertCommand
da.UpdateCommand = cb.GetUpdateCommand
da.DeleteCommand = cb.GetDeleteCommand
da.Fill(ds, "Customers")


'and you've added the following Save button logic:

If ds.HasChanges Then
Dim dc As DataSet
dc = ds.GetChanges()
da.Update(dc, "Customers")
ds.AcceptChanges()
End If


la mi adomanda è:

avendo il progetto duddiviso in classi e le classi che eseguono le connessioni e le query sono dei web service

come posso procedere per fare tornare il dataset al metodo e aggoirnarlo senza doverlo luppare riga x riga e fare l'uldate di ogni singola riga????

come posso unsare l'odbc data adadpter

Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5