Show ID in Textbox C # [closed]

0

Companions I am developing a project in ASP.NET C #, the problem is that I want to show the ID in a textbox of my form, which is increasing one by one, I'm doing highs, lows, changes, for example when adding a new record shows the ID in the textbox but it increases to be able to register it in my SQL Data Base. I do not know if you explain.

    
asked by KlonDTS 15.02.2017 в 18:38
source

1 answer

0

How often do you want that ID to increase ?, each time the user loads that form ?, or each time the user touches a button ?. If your ID is Autoincremental every time the user executes one of the two events mentioned above you should insert data to increase the first and key and then in the BD have a stored procedure to bring the last ID

SELECT TOP(1) ID
FROM "Nombre Tabla"
ORDER BY ID ASC;
    
answered by 15.02.2017 / 19:38
source