2013年8月29日 星期四

Edit Rows in a DataTable

引用來源:MSDN How to: Edit Rows in a DataTable
--
一般都是 新增/刪除
使用陣列方式可更新資料

 Dim customersRow As NorthwindDataSet.CustomersRow
customersRow = NorthwindDataSet1.Customers.FindByCustomerID("ALFKI")

customersRow.CompanyName = "Updated Company Name"
customersRow.City = "Seattle"


--
'更新 
Dim customerRow() As Data.DataRow  '須使用陣列
customerRow = DataSet1.Tables("Customers").Select("CustomerID = 'ALFKI'")

customerRow(0)("CompanyName") = "Updated Company Name"
customerRow(0)("City") = "Seattle" 

沒有留言:

張貼留言