Heuh? I was preparing an answer based on message alerts I got, but now when I wanted to post the answer, the questions are gone ... ;)
I am not sure if I am changing the intention, but this should work:
DataRow drChatRoom;
int lastCategoryID = 0;
foreach (drChatRoom in dtChatRoom.Rows)
{
int CategoryId = dtChatRoom.Rows(currentRow).Item("CatID").ToString ();
(e.g. remove the int datatype for drChatRoom in the loop.)
Or:
int lastCategoryID = 0;
foreach (DataRow in dtChatRoom.Rows)
{
int CategoryId = dtChatRoom.Rows(currentRow).Item("CatID").ToString ();
Besides this, I think
dtChatRoom.Rows(currentRow)
has to be
dtChatRoom.Rows[currentRow]
as it is an indexer, not a method....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.