Edit Datatable using data view problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sri

    #1

    Edit Datatable using data view problem

    Hi,

    I have a datatable to store some values like name, id etc. in ASP.NET
    I have scenario where i need to modify more than one records of the
    datatable . I am trying to use dataview as below.

    If mdviewmodifyGro up.Count > 0 Then
    mdviewmodifyGro up.AllowEdit = True

    For pintCount = 0 To mdviewmodifyGro up.Count - 1
    mdviewmodifyGro up(pintCount).B eginEdit()
    mdviewmodifyGro up(pintCount)(" Name") = txtModifyName.T ext
    mdviewmodifyGro up(pintCount).E ndEdit()
    Next
    end if

    In the for loop, the first record gets updated and then it throws me
    following exception.

    "Index 1 is not non-negative and below total rows count" ???
    I dont understand what i am doing wrong..? I checked the count of
    mdviewmodifyGro up.Count and its grater than 1 (usually 2 or 3 in my case)

    Please let me know how i can get around this issue..? any help or pointers
    inthis will be greatly appreciated.

    TIA,
    -sri




Working...