473,387 Members | 1,485 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,387 software developers and data experts.

TableAdapter generate identity

I add new row to DataTable (typed).
I called TableAdapter.Upadte method.
I noticed that field 'ItemId' (which is specified as Identity in SQL Server)
has a value of new added item.
This is great!

Is this feature documented?
Can i use it in production?

I also noticed when using Access, AutoNumber field as ItemId, this feature
does not work. (ItemId stays 0)
May 8 '07 #1
1 6888
Tempera,

When you created your typed data set, the generator noticed that the
table in SQL Server has an identity column which is auto incremented.
Because of that, the DataColumn that represents the identity column has the
AutoIncrement, AutoIncrementSeed and AutoIncrementStep properties set so
that the TableAdapter will correctly update the column.

So yes, you can use it. This is the documentation you will want to
reference:

http://msdn2.microsoft.com/en-us/lib...t0(VS.80).aspx

As well as:

http://msdn2.microsoft.com/en-us/lib...1y(VS.80).aspx

I'm not sure why it doesn't work for access though. I try to avoid it
like the plague =)
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tempera" <te****@at.comwrote in message
news:f1**********@garrison.globalnet.hr...
>I add new row to DataTable (typed).
I called TableAdapter.Upadte method.
I noticed that field 'ItemId' (which is specified as Identity in SQL
Server) has a value of new added item.
This is great!

Is this feature documented?
Can i use it in production?

I also noticed when using Access, AutoNumber field as ItemId, this feature
does not work. (ItemId stays 0)

May 8 '07 #2

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

Similar topics

0
by: ad | last post by:
I study the new feature of dataset in VS2005. When in a WinForm application, After I create a new DataSet with the IDE of VS2005, it will generate a Desginer file with the .xsd file. For...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
0
by: vbnetguy | last post by:
Hopefully someone has an answer for this or maybe I am missing something. I have a stored procedure - this stored procedure is used as my main insert for a tableadapter I am doing something...
1
by: Demetri | last post by:
I have a question / concern regarding the new suggested way of creating a data access layer in an n-tier application. Typically, a web application specifically, using the SOA (Service Oriented...
0
by: TinMan | last post by:
in my 2.0 ASP.Net app I'm using the TableAdapter Configuration wizard and asking it to generate Selece, Update, Insert, and Delete. It did not generate the delete! Why? Thanks, T
0
by: Elmo Watson | last post by:
Let's say I have a tableAdapter which uses an Insert sProc -- the last line in the sProc is a Select statement, returning the identity in code, I write something like: Dim myTA as (TableAdapter)...
2
by: GaryDean | last post by:
I'm comparing use of DataView -ObjectDataSource -TableAdapter to DataView -SqlDataSource using the Customers table on the NorthWind database. The SQL given to both wizards is: SELECT ...
1
by: gmccallum | last post by:
I would have expected to be able to find this easily, but I couldn't. I am using the TableAdapter.Insert command to insert a record. I would like to then get an ID field from that record after...
1
by: =?Utf-8?B?RGV2YW4=?= | last post by:
Hi, I have a table adapter for a database with an insert query. I want to be able to get the PRIMARY key of the inserted record for that insert statement. I know that SCOPE_IDENTITY is the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.