ghassan_aljabiri
Member
- Joined
- Mar 25, 2009
- Messages
- 23
- Programming Experience
- Beginner
hello
I use this code to insert a record to a table
the record contains an autonumber field (cid)
i need this value after inserting
I used this code
but it returns the id of the last record before adding the new one
how to get the right value
Regards
I use this code to insert a record to a table
VB.NET:
CustodiesTableAdapter.InsertQuery(cname, Now.Date, 0, cnotes, eid)
the record contains an autonumber field (cid)
i need this value after inserting
I used this code
VB.NET:
CustodiesBindingSource.MoveLast()
Dim cid As Long = CLng(DirectCast(CustodiesBindingSource.Current, DataRowView)("cid"))
but it returns the id of the last record before adding the new one
how to get the right value
Regards