Generate DateRow for every row in a dataset

Total Post:110

Points:774
VB.Net 
 1292  View(s)
Ratings:
Rate this:
Dim diaryreader As SqlDataReader
diarycmd.CommandText = "dashboardusers"
diarycmd.CommandType = CommandType.StoredProcedure
diarycmd.Connection = usersconn
diaryconn.Open()
diaryreader = diarycmd.ExecuteReader() 
Dim diaryTable As DataTable = New DataTable()
diaryTable.Load(diaryreader)
Dim dr As DataRow
for each (dr in diaryTable.rows)

Next

This is not working, I am getting a syntax error when i try to do for each dr in diarytable.rows

  1. Post:378

    Points:2694
    Re: Generate DateRow for every row in a dataset

    Hi Jayden, 


    You get errors because your braces are set wrong. This would work:

    Dim dr As DataRow

    For Each dr In diaryTable.Rows

    Next

Answer