473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Adding new record to table adapter

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.A ssets,
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
Nov 30 '05 #1
3 2017
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.Asse ts) to get all the
modified records updated.

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

Dec 1 '05 #2
Thank you.

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:RB**************@TK2MSFTNGXA02.phx.gbl...
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.Asse ts) to get all the
modified records updated.

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

Dec 1 '05 #3
You're welcome.

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

Dec 2 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
10
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to...
4
by: jaYPee | last post by:
I'm wondering if it is possible to pull a record(s) from an adapter and put it on a datagrid based on the criteria on the form. example: sqldataadapter1 contains "course" table. and i want to...
3
by: RPK | last post by:
I am using following code to Add New Record in a Table (Temp in this case). I want to save new record with this method i.e., non-SQL. It is not commiting changes. The "Update" statement has errors....
0
by: Mateusz [PEYN] Adamus | last post by:
Hi I have a Typed DataSet. I've databinded it to some text controls on my form, controls show data when I show record. But now I would like to create a new record with this form, controls...
7
by: Miro | last post by:
Im a VB Newbie so I hope I'm going about this in the right direction. I have a simple DB that has 1 Table called DBVersion and in that table the column is CurVersion ( String ) Im trying to...
8
by: Tony A. | last post by:
I'm using VB .Net 2005 with Access 2003 for the database. The database has two tables: tblContact (ContactNum (k), lastname, firstname, phone, email, compNum) and tblCompany (CompNun (k),...
3
by: rcoco | last post by:
Hi, I'm trying to Insert a new Row on a dagrid. When I did a google search, I got an example on this address: http://www.codeproject.com/ASPNET_DataGrid.asp. I've done mycode as follows: ...
1
by: vbDavidC | last post by:
I am adding a new record to a table via a dataset/adapter. I have got the following to work for me but I am wondering if there is a better way to do this. I am having to have something in my...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.