Advertisement

04.13.2008 at 05:35AM PDT, ID: 23318424
[x]
Attachment Details

VB: Optimizing datatable check

Asked by AWestEng in .Net Editors & IDEs, Microsoft Visual Basic.Net, Visual Studio .NET 2005

Tags: VS 2005, VB

Hi I have this code

Can I write this in a better way. What I do is that I check if zone exists in my collection if it does I also want to check if this is a payzone and if it's not I need to change a parameter that says this row has a zone error.

        For Each MyRow As DataRow In dtSource.Rows
            If m_Zones.Contains(CStr(MyRow("Zones"))) And Not MyRow("Pay") Is "1" Then
                MyRow.Item("ZoneError") = "1"
                MyRow.AcceptChanges()
            End If
        NextStart Free Trial
[+][-]04.13.2008 at 06:12AM PDT, ID: 21344628

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.13.2008 at 09:50AM PDT, ID: 21345301

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Visual Basic.Net, Visual Studio .NET 2005
Tags: VS 2005, VB
Sign Up Now!
Solution Provided By: FernandoSoto
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628