Results 1 to 2 of 2

Thread: Update datatable by code

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    3

    Question Update datatable by code

    Hei,
    In my vb.net winapp I have a datagrid that uses a datatable (dtGridReport) as datasource.
    When I try to update one field in my datatable something strange happens.
    It looks as if a row is added to the datagrid, a new row appears, which is a copy of the row I wanted to update.
    The datatable still contains the correct number of rows.

    An example of code to change the data which causes the problem to occur:
    Dim dr As DataRow() = dtGridReport.Select("sFkAccountID = '0301'")
    If dr.GetUpperBound(0) = 0 Then
    dr(0)("sValue") = "whatever"
    End If

    Does anybody know why this happens or what I can do to fix it?

    >Lars<

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    3
    I've found out it only happens when I have added rows to the datatable using InsertAt()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width