469,953 Members | 1,936 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

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 6731
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by GaryDean | last post: by
reply views Thread by TinMan | last post: by
reply views Thread by Elmo Watson | last post: by
2 posts views Thread by GaryDean | last post: by
1 post views Thread by gmccallum | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.