Adding new record to table adapter

V

Vayse

When my form loads, I want to fill the TableAdapter

Select Case iAssetView
Case conVIEW_ASSET
' Load 1 Asset
Me.AssetsTableAdapter.FillByAsset(Me.AssetsDataSet.Assets,
stAssetCode)
Case conVIEW_SUB
' All assets in the sub category
Me.AssetsTableAdapter.FillBySub(Me.AssetsDataSet.Assets,
lSubCatgID)
Case conNEW_ASSET
' What should I do here?
Case Else
' Otherwise load all assets
Me.AssetsTableAdapter.Fill(Me.AssetsDataSet.Assets)
End Select

What should I do in the case of a new Asset?

Regards
Vayse
 
K

Kevin Yu [MSFT]

Hi Vayse,

The TableAdapter is just a connection between the database table and the
table in the DataSet. So if you need to add new record to the Asset, just
add to dataset.Asset table. Then use
Me.AssetsTableAdapter.Update(Me.AssetsDataSet.Assets) to get all the
modified records updated.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
K

Kevin Yu [MSFT]

You're welcome.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top