I have a 10 column DataTable that pulls data from a SQL database. I am trying to give an in-line edit option that when pressing a cell in the table, a pop up window opens and you are able to edit the specific value in the cell.
My problem is that I need to find the name of the column so I know what value to change in the database. I found a way to get the column number (zero based), the number of the row I am editing and of course the new value I wish to change to.
My SQL update string looks like this:
"UPDATE " + tableName + " SET ??? = " + "'" + newVal + "'" + " WHERE [UserName] = " + id;
and as you can see I have no idea what to write instead of the "???".
Hope I was clear with my explanation.
Maybe this will help: as I said, I know the number of the column that is trying to be edited using:
var col = $(this).parent().children().index($(this));