Deleting a row an item from a datagrid problems?? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Deleting a row an item from a datagrid problems??

jbmarsh80jbmarsh80 Posts: 7Member
Hey everyone,

I am having a problem with a datagrid i set up. I can update the source just fine, but when i go to delete records, i get problems. As long as the primary Keys are in order and do not skip a number, it works fine, but when i add a record, delete it, then add another record, I can't delete the second record. The delete link shows as though it's been clicked before too. I don't know what's causing this problem. Here is the source i am using. Can anyone help??

sub asGrid_Delete(obj as object, e as DataGridCommandEventArgs)
dim strSQL as string = "DELETE FROM tbAvailableSituations _
WHERE asID = " & e.Item.ItemIndex + 1
ExecuteStatement(strSQL)
UpdateDate()
FillasDataGrid()
end sub





' />











Comments

  • cvbijucvbiju Posts: 7Member
    : Hey everyone,
    :
    : I am having a problem with a datagrid i set up. I can update the source just fine, but when i go to delete records, i get problems. As long as the primary Keys are in order and do not skip a number, it works fine, but when i add a record, delete it, then add another record, I can't delete the second record. The delete link shows as though it's been clicked before too. I don't know what's causing this problem. Here is the source i am using. Can anyone help??
    :
    : sub asGrid_Delete(obj as object, e as DataGridCommandEventArgs)
    : dim strSQL as string = "DELETE FROM tbAvailableSituations _
    : WHERE asID = " & e.Item.ItemIndex + 1
    : ExecuteStatement(strSQL)
    : UpdateDate()
    : FillasDataGrid()
    : end sub
    :
    :
    :
    :
    :
    : ' />
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :

    c v Biju

  • cvbijucvbiju Posts: 7Member
    Visit this link,
    http://www.aspnet.4guysfromrolla.com/articles/080702-1.2.aspx

    look for the other parts.It is a multipart document(9 parts) and in one of the part..he has given the correct syntax to delete.


    : : Hey everyone,
    : :
    : : I am having a problem with a datagrid i set up. I can update the source just fine, but when i go to delete records, i get problems. As long as the primary Keys are in order and do not skip a number, it works fine, but when i add a record, delete it, then add another record, I can't delete the second record. The delete link shows as though it's been clicked before too. I don't know what's causing this problem. Here is the source i am using. Can anyone help??
    : :
    : : sub asGrid_Delete(obj as object, e as DataGridCommandEventArgs)
    : : dim strSQL as string = "DELETE FROM tbAvailableSituations _
    : : WHERE asID = " & e.Item.ItemIndex + 1
    : : ExecuteStatement(strSQL)
    : : UpdateDate()
    : : FillasDataGrid()
    : : end sub
    : :
    : :
    : :
    : :
    : :
    : : ' />
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    :
    : c v Biju
    :
    :

    c v Biju

Sign In or Register to comment.