附 dbdataadapter.update方法的所有重载版本
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 integer
n overloads public function update(byval dataset as dataset,byval srctable as string) as integer
示例
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 here
mydataadapter.update(custds)
code to modify data in dataset here
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 here
mydataadapter.update(custdt)
myconn.close()
return custds
end function selectoledbsrvrows
附 dbdataadapter. fill方法的所有重载版本
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 integer
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 srctable as string) as integer
n overloads protected overridable function fill(byval dataset as dataset, byval srctable as string,byval datareader as idatareader,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