How to loop a dataset to process data row by row

Discussion in 'Suggestions and Feedback' started by Bruce, Apr 28, 2004.

  1. Bruce

    Bruce DiscountASP.NET Staff

    It's similiar.

    see http://kb.discountasp.net/article.aspx?id=10023

    quote:Originally posted by jerry1027

    Dear all,

    I am new to ASP.Net and I have generated a dataset but I need to do some calculation on the data before showing them in the datagrid. How can I process the dataset row by row just as we often do in ASP?

    In ASP we often wrote :
    Do while not rsData.eof
    .........
    rsData.Movenext
    End While

    But what about in ASP.Net?

    Jerry the man
    </blockquote id="quote"></font id="quote">
     
  2. Dear all,

    I am new to ASP.Net and I have generated a dataset but I need to do some calculation on the data before showing them in the datagrid. How can I process the dataset row by row just as we often do in ASP?

    In ASP we often wrote :
    Do while not rsData.eof
    .........
    rsData.Movenext
    End While

    But what about in ASP.Net?

    Jerry the man
     
  3. I usually do a for each loop similar to this:

    'ds = dataset
    'dt = datatable
    'dr = datarow

    dt = ds.tables("tablename")
    for each dr in dt.rows
    dr("FieldName")
    next

    quote:Originally posted by jerry1027

    Dear all,

    I am new to ASP.Net and I have generated a dataset but I need to do some calculation on the data before showing them in the datagrid. How can I process the dataset row by row just as we often do in ASP?

    In ASP we often wrote :
    Do while not rsData.eof
    .........
    rsData.Movenext
    End While

    But what about in ASP.Net?

    Jerry the man
    </blockquote id="quote"></font id="quote">

    Eric Brasher
     

Share This Page