欢迎光临
我们一直在努力

简述DbDataAdapter.Update 方法(续)-.NET教程,数据库应用

建站超值云服务器,限时71元/月

附 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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 简述DbDataAdapter.Update 方法(续)-.NET教程,数据库应用
分享到: 更多 (0)