I have a (very simple) problem that I just can not solve:
I am populating a datagrid from SQL server using a Dataset.
The table
in question uses an Identity row, which increments by one
for every new
insert.
When I delete an entry, my usual code, which goes
"SELECT * FROM table WHERE ID = ID-1"
da.SelectCommand.parameters.add( ID, SqlDbType.int);
da.SelectCommand.parameters[ ID].value =
datagrid.selectedIndex;
no longer works, as there are gaps in the identity column.
At the moment, the only solution I have is to select the
entire table
into a temproray table with a new rownumber( which will have
no gaps),
and work with the rownumber instead. Once the selected row
is in my
webpage, the temporary table is dropped, and recreated
everytime a
selection is made from the datagrid
this is obviously less than elegant and I need to finish
this soon.
What did I overlook?
Any pointers are greatly appreciated as this is driving me
around the
bend by now.
Sven
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharp googlegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribe googlegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---
|