none
How do i iterate through rows in a typed dataset.xsd?

    Question

  • hi friends,

    I have create a ds.xsd for a datacache and create a table QNA to load 60 questions with answers. But how do i iterate through each row of table QNA?

    thanks

    Sunday, November 28, 2010 3:28 AM

Answers

  • Hi code_warrior,

    Try

    foreach(ds.QNADataRow qnadr in ds1.QNA.Rows)
     DoStuff(qnadr);
    

    NOTE: ds is namespace of your dataset and ds1 is an object of your dataset.

    Sincerely,

    Yasser.


    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    • Marked as answer by code_warrior Sunday, November 28, 2010 8:26 AM
    Sunday, November 28, 2010 7:31 AM
  • Is QNA is your dataset class and q is an object of it? if so
    q = new QNA();
    foreach(QNA.QusetionAnswersCacheRow item in q.QusetionAnswersCache.Rows)
     DoStuff(item);
    

    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    • Marked as answer by code_warrior Sunday, November 28, 2010 8:25 AM
    Sunday, November 28, 2010 8:14 AM

All replies

  • Hi code_warrior,

    Try

    foreach(ds.QNADataRow qnadr in ds1.QNA.Rows)
     DoStuff(qnadr);
    

    NOTE: ds is namespace of your dataset and ds1 is an object of your dataset.

    Sincerely,

    Yasser.


    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    • Marked as answer by code_warrior Sunday, November 28, 2010 8:26 AM
    Sunday, November 28, 2010 7:31 AM
  • Hi code_warrior,

    Try

    foreach(ds.QNADataRow qnadr in ds1.QNA.Rows)
    
     DoStuff(qnadr);
    
    

    NOTE: ds is namespace of your dataset and ds1 is an object of your dataset.

    Sincerely,

    Yasser.


    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords


    i cannot find the Rows collection in the table:

     

    From Drop Box

     

    Sunday, November 28, 2010 8:10 AM
  • Is QNA is your dataset class and q is an object of it? if so
    q = new QNA();
    foreach(QNA.QusetionAnswersCacheRow item in q.QusetionAnswersCache.Rows)
     DoStuff(item);
    

    DO YOU STORE AND VERIFY PASSWORDS USING KEYS?! LEARN A BETTER WAY DURING A QUICK SIMPLE HOW TO:
    How To: Storing and verifying passwords
    • Marked as answer by code_warrior Sunday, November 28, 2010 8:25 AM
    Sunday, November 28, 2010 8:14 AM