0

I am building an application (vb.net and MySql) in which multiple users (using multiple computers) can add tasks.

In order to get a new number for each task they add, i have created a value in My.Settings (lets Call it TaskNumber)

The main idea is that whenever a user will open a new task, i will load the number from the My.Settings, increase the value by 1 and save it.

If I inderstand correctly, since it is 'User based' and saved in %appdata%, every user will start from the first number i have configured in the app and will make duplicates in the Database (forbidden - unique)

Logically I would expect to make this value "Application Based" but if I change the scope of the property to 'application' it says its read only - and that the script cannot modify it

I know i can use a table with a single record with column for each desired serial number i need in the app and update it when needed but i was hoping VB can make it easier.

any suggestion? Thanks,

RobinHud
  • 11
  • 9
  • use auto increment columns in mysql – Iłya Bursov Mar 04 '16 at 21:04
  • seems like a good idea, can you explain how i interact with the database from VB.net ? I understand it will start with "Insert" wil one column i write to the DB, and MySQL will create the record with the next number, now i got to bring it to the app so i can update all the other records, how do i know what number it has recieved from the A_I ? – RobinHud Mar 04 '16 at 21:23
  • to interact with database you need to write code which will open connection and send queries to it – Iłya Bursov Mar 04 '16 at 21:24
  • i know exactly how to create the connection , insert records, update them and query, but how do i know what the number that A_I has created for me ? – RobinHud Mar 04 '16 at 21:28
  • http://dev.mysql.com/doc/refman/5.7/en/getting-unique-id.html – Iłya Bursov Mar 04 '16 at 21:28

0 Answers0