CommandBuilder






Imports Microsoft
Imports System
Imports System.Windows.Forms
Imports System.Data
Imports System.Data.SqlServerCe



'''procedure



Try
Dim conn As New SqlCeConnection("Data Source=\program files\Acqua.sdf; Password=paolo;")
conn.Open()

Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM Letture"

Dim adp As New SqlCeDataAdapter(cmd)

Dim cb As New SqlCeCommandBuilder()
cb.DataAdapter = adp

MessageBox.Show(cb.GetUpdateCommand().CommandText)
MessageBox.Show(cb.GetInsertCommand().CommandText)
MessageBox.Show(cb.GetDeleteCommand().CommandText)

Dim ds As New DataSet("test")
adp.Fill(ds)

' Modify the contents of the DataSet

'

ds.Tables(0).Rows(0)("LettPrecedente") = 111111

adp.Update(ds)

Catch e1 As Exception
MsgBox(e1.ToString())
End Try










( commandbuilder.html )- by Paolo Puglisi - Modifica del 17/12/2023