-1

I am trying to alter an existing programm in VB , I am not experienced in this language , but unfortunately I cannot convert it for now.

I created the DB Connections with the Designer , which automatically created the BindingSource, TableAdapter , DataSet .

I insert something into this table like this :

Me.Validate()

myBindingSource.EndEdit()

myTableAdapter.Insert(1, 1, "test", 100, Now, 1, Now)

I would now like to get CURRENT_SEED valuer for the ID field ( which is Autoincrement ) can I do it somehow here without making some extra connection , is it returned somewhere ?

Regards Robert

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
user1937012
  • 1,031
  • 11
  • 20

1 Answers1

0

If you want to use table adapters for ease, just created a "Select Max(ID) From myTable" scalar query then just call it to get the last value.

int resultID = myTableAdapter.GetLastID();
Simon Curtis
  • 382
  • 2
  • 9