本文整理汇总了VB.NET中System.Data.Common.DbDataAdapter.Update方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DbDataAdapter.Update方法的具体用法?VB.NET DbDataAdapter.Update怎么用?VB.NET DbDataAdapter.Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了DbDataAdapter.Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CreateCmdsAndUpdate
Public Function CreateCmdsAndUpdate(ByVal connectionString As String, _
ByVal queryString As String, _
ByVal tableName As String) As DataSet
Using connection As New OleDbConnection(connectionString)
Dim adapter As New OleDbDataAdapter()
adapter.SelectCommand = New OleDbCommand(queryString, connection)
Dim builder As New OleDbCommandBuilder(adapter)
connection.Open()
Dim customers As New DataSet()
adapter.Fill(customers)
' Code to modify data in DataSet here
adapter.Update(customers, tableName)
Return customers
End Using
End Function
示例2: CreateCmdsAndUpdate
Public Function CreateCmdsAndUpdate(ByVal connectionString As String, _
ByVal queryString As String) As DataTable
Using connection As New OleDbConnection(connectionString)
Dim adapter As New OleDbDataAdapter()
adapter.SelectCommand = New OleDbCommand(queryString, connection)
Dim builder As New OleDbCommandBuilder(adapter)
connection.Open()
Dim customers As New DataTable()
adapter.Fill(customers)
' Code to modify data in DataTable here
adapter.Update(customers)
Return customers
End Using
End Function
示例3: CreateCmdsAndUpdate
Public Function CreateCmdsAndUpdate(ByVal connectionString As String, _
ByVal queryString As String) As DataSet
Using connection As New OleDbConnection(connectionString)
Dim adapter As New OleDbDataAdapter()
adapter.SelectCommand = New OleDbCommand(queryString, connection)
Dim builder As New OleDbCommandBuilder(adapter)
connection.Open()
Dim customers As New DataSet()
adapter.Fill(customers)
' Code to modify data in DataSet here
adapter.Update(customers)
Return customers
End Using
End Function
示例4: CreateCmdsAndUpdate
Public Function CreateCmdsAndUpdate(ByVal connectionString As String, _
ByVal queryString As String) As DataSet
Using connection As New OleDbConnection(connectionString)
Dim adapter As New OleDbDataAdapter()
adapter.SelectCommand = New OleDbCommand(queryString, connection)
Dim builder As New OleDbCommandBuilder(adapter)
connection.Open()
Dim customers As New DataSet()
adapter.Fill(customers)
' Code to modify data in DataSet here
' Insert new records from DataSet
Dim rows() As DataRow = customers.Tables(0).Select( _
Nothing, Nothing, DataViewRowState.Added)
adapter.Update(rows)
Return customers
End Using
End Function