foreach in managed c++

G

Guest

Hi,

I am working on interop using C and managed c++ (on Visual Studio 2003 IDE).
How do i simulate the foreach loop present in C# or VB.NET in MC++

foreach (DataRow dr in ds.Tables[0].Rows) equivalent in MC++?

Thanks
 
N

Nishant S

IEnumerator* en = ds.Tables[0].Rows->GetEnumerator();

while(en->MoveNext())
{
DataRow* dr = dynamic_cast<DataRow*>(en->Current);
//...
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top