I am writing a C# program right now that uses a datatable that is connected to a SQL database. I need to allow the program to delete the highlighted row from both the program and the database. Right now I have a working event on key press delete that runs a SQLcommand to remove the entry, however, it removes all entries and not the selected row (this is due to a different problem). Basically, I am wondering how I can return what row is currently highlighted. If I can return that number then I can continue on with my program.
For example, I have data in the first 5 rows of the datatable but id like to highlight(by clicking) and delete the 3rd row. If I can return the third row then I can write a different SQL statement to handle based off of a different set of criteria.
Thanks.