asp.net的数据库更新方法?
展开全部
用数据集更新么 ,例如
Dim newRow As DataRow = dsXi.Tables(0).NewRow()
newRow.Item(0) = tbXiHaoZeng.Text
newRow.Item(1) = tbXiMingZeng.Text
newRow.Item(2) = ddlYuanHaoXiZeng.SelectedItem.Text
dsXi.Tables(0).Rows.Add(newRow)
Dim cb As New SqlCommandBuilder(sdaXi)
sdaXi.Update(dsXi, "系")
dsXi.Tables(0).AcceptChanges()
Dim newRow As DataRow = dsXi.Tables(0).NewRow()
newRow.Item(0) = tbXiHaoZeng.Text
newRow.Item(1) = tbXiMingZeng.Text
newRow.Item(2) = ddlYuanHaoXiZeng.SelectedItem.Text
dsXi.Tables(0).Rows.Add(newRow)
Dim cb As New SqlCommandBuilder(sdaXi)
sdaXi.Update(dsXi, "系")
dsXi.Tables(0).AcceptChanges()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询