Appframe Knowledge Base


1 hits
0

How to insert new record through code

Dim vSource As AppFrame3.Win.Data.afDataObject = DirectCast(dbgRelated.DataSource, AppFrame3.Win.Data.afDataObject)  'GetCurrent DataSource for datagrid
Dim vCurrent As DataRow = vSource.CurrentRow            'Get Current Selected Row
Dim vNewRow As DataRow = vCurrent.Table.NewRow()  'Create new Row object inheriting from existing table row
vNewRow.Item("DocDwgID") = "DocDwgID"
vNewRow.Item("Title") = "Title"
vNewRow.Item("CurrentRev") = "Rev"
vNewRow.Item("RevDate") = "2007.01.01"
vCurrent.Table.Rows.Add(vNewRow) 'Post Data to dataSource

win · Perma link post comment Posted by: Peter Øren (13-jan-2012)