Brief introduction of Dbdataadapter.update Method (cont.)

Source: Internet
Author: User
Tags integer versions
Attach all overloaded versions of the Dbdataadapter.update method

n Overloads Public Function Update (ByVal datarows () as DataRow) as Integer

n Overrides Overloads public Function Update (ByVal DataSet as DataSet) as Integer Implements idataadapter.update

n Overloads Public Function Update (ByVal DataTable as DataTable) as Integer

n Overloads Protected Overridable Function Update (ByVal datarows () as Datarow,byval TableMapping as DataTableMapping) as I Nteger

n Overloads Public Function Update (ByVal dataSet as Dataset,byval srctable as String) as Integer



Example

Public Function createcmdsandupdate (myDataSet as DataSet, MyConnection as String, mySelectQuery as String, mytablename as String) as DataSet

Dim myconn as New OleDbConnection (MyConnection)

Dim MyDataAdapter as New OleDbDataAdapter ()

Mydataadapter.selectcommand = New OleDbCommand (mySelectQuery, myconn)

Dim CUSTCB as OleDbCommandBuilder = New OleDbCommandBuilder (mydataadapter)



MyConn.Open ()

Dim custDS as DataSet = New DataSet

Mydataadapter.fill (custDS)



' Code to modify data in DataSet

Mydataadapter.update (custDS)



' Code to modify data in DataSet

Mydataadapter.update (custDS, Mytablename)



' Insert new records from DataSet

Dim Mydatarowarray () as DataRow = Custds.tables (0). Select (Nothing, nothing, dataviewrowstate.added)

Mydataadapter.update (Mydatarowarray)



Dim Custdt as DataTable = New DataTable

Mydataadapter.fill (CUSTDT)

' Code to modify data in DataTable

Mydataadapter.update (CUSTDT)



Myconn.close ()

Return custDS

End Function ' Selectoledbsrvrows



Attached DbDataAdapter. All overloaded versions of the Fill method

n Overloads Public Function Fill (ByVal DataTable as DataTable, ByVal Adodbrecordset as Object) as Integer

n Overloads Public Function Fill (ByVal dataSet as Dataset,byval Adodbrecordset as Object,byval srctable as String) as inte Ger

n Overrides Overloads public Function Fill (ByVal DataSet as DataSet) as Integer Implements Idataadapter.fill

n Overloads Public Function Fill (ByVal DataTable as DataTable) as Integer

n Overloads Public Function Fill (ByVal dataSet as Dataset,byval srctable as String) as Integer

n Overloads Protected Overridable Function Fill (ByVal dataTable as Datatable,byval DataReader as IDataReader) as Integer

n Overloads Protected Overridable Function Fill (ByVal dataTable as Datatable,byval command as idbcommand,byval behavior as CommandBehavior) as Integer

n Overloads Public Function Fill (ByVal dataSet as Dataset,byval Startrecord as Integer,byval maxrecords as Integer,byval s Rctable as String) as Integer

n Overloads Protected Overridable Function Fill (ByVal DataSet as DataSet, ByVal srctable as String,byval DataReader as IDa Tareader,byval Startrecord as Integer,byval maxrecords as Integer) As Integer

n Overloads Protected Overridable Function Fill (ByVal DataSet as DataSet, ByVal Startrecord as Integer,byval maxrecords as Integer,byval srctable as String,byval command as idbcommand,byval behavior as CommandBehavior) as Integer



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.