Click here to Skip to main content
15,903,012 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Best Practice for Guids in Method Parameters Pin
john202123-Apr-07 9:20
john202123-Apr-07 9:20 
AnswerRe: Best Practice for Guids in Method Parameters Pin
kubben23-Apr-07 9:48
kubben23-Apr-07 9:48 
Questionhow to convert .sql to .mdb file Pin
preci23-Apr-07 5:22
preci23-Apr-07 5:22 
AnswerRe: how to convert .sql to .mdb file Pin
Dave Kreskowiak23-Apr-07 5:34
mveDave Kreskowiak23-Apr-07 5:34 
QuestionDialing a Phone Number from Visual Basic Pin
S.Rajeshwar23-Apr-07 5:14
S.Rajeshwar23-Apr-07 5:14 
AnswerRe: Dialing a Phone Number from Visual Basic Pin
Dave Kreskowiak23-Apr-07 5:37
mveDave Kreskowiak23-Apr-07 5:37 
GeneralRe: Dialing a Phone Number from Visual Basic Pin
keninfo24-Apr-07 2:07
keninfo24-Apr-07 2:07 
QuestionProblem with dt.Rows.Count Pin
RichardBerry23-Apr-07 1:36
RichardBerry23-Apr-07 1:36 
Hi

In the code below, I'm looping through all the items in dtPackBom2 and for each item I then loop through dtExclusions. If the item in dtPackBom2 exists in dtExclusions then I delete it from dtPackBom2.

What happens is that even though the loop is
For BomRow As Integer = 0 To Me.dtPackBom2.Rows.Count - 1

after you delete a row, I get an exception saying there is no row at position xxx. I then tried adding the row Me.dtPackBom2.AcceptChanges() after I delete a row, hoping that dtPackBom2.Rows.Count will now see the new reduced number of rows but I still get the same exception.

It seems to work if I put: If BomRow = Me.dtPackBom2.Rows.Count - 1 Then Exit For


For BomRow As Integer = 0 To Me.dtPackBom2.Rows.Count - 1
If BomRow = Me.dtPackBom2.Rows.Count - 1 Then Exit For
For i As Integer = 0 To Me.dtExclusions.Rows.Count - 1
If Me.dtPackBom2.Rows(BomRow).Item(2) = Me.dtExclusions.Rows(i).Item(0) Then
Me.dtPackBom2.Rows(BomRow).Delete()
Me.dtPackBom2.AcceptChanges()
Exit For
End If
Next 'i
Next 'BomRow

WHY IS THIS HAPPENING. SURELY THE EXPRESSION Me.dtPackBom2.Rows.Count - 1 IS EVALUATED EACH TIME THE LOOP IS EXECUTED?

IS THERE A BETTER WAY TO DO THIS?

AnswerRe: Problem with dt.Rows.Count Pin
andyharman23-Apr-07 2:53
professionalandyharman23-Apr-07 2:53 
AnswerRe: Problem with dt.Rows.Count Pin
Dave Kreskowiak23-Apr-07 5:51
mveDave Kreskowiak23-Apr-07 5:51 
GeneralRe: Problem with dt.Rows.Count Pin
RichardBerry23-Apr-07 22:05
RichardBerry23-Apr-07 22:05 
QuestionData type mismatch in criteria expression. Pin
peteyshrew22-Apr-07 23:40
peteyshrew22-Apr-07 23:40 
AnswerRe: Data type mismatch in criteria expression. Pin
Colin Angus Mackay23-Apr-07 0:21
Colin Angus Mackay23-Apr-07 0:21 
AnswerRe: Data type mismatch in criteria expression. Pin
RichardBerry23-Apr-07 1:39
RichardBerry23-Apr-07 1:39 
GeneralRe: Data type mismatch in criteria expression. Pin
Colin Angus Mackay23-Apr-07 3:35
Colin Angus Mackay23-Apr-07 3:35 
GeneralRe: Data type mismatch in criteria expression. Pin
ChandraRam23-Apr-07 3:43
ChandraRam23-Apr-07 3:43 
GeneralRe: Data type mismatch in criteria expression. Pin
Colin Angus Mackay23-Apr-07 4:02
Colin Angus Mackay23-Apr-07 4:02 
QuestionCrystal Reports Exporting Problem Pin
freefika22-Apr-07 23:01
freefika22-Apr-07 23:01 
QuestionVery URGENT.......Serial Port Buffer Pin
navyasri22-Apr-07 21:55
navyasri22-Apr-07 21:55 
AnswerRe: Very URGENT.......Serial Port Buffer Pin
Patrick Etc.23-Apr-07 18:49
Patrick Etc.23-Apr-07 18:49 
QuestionFace detection algorithm? Pin
tuanlm7522-Apr-07 20:28
tuanlm7522-Apr-07 20:28 
AnswerRe: Face detection algorithm? Pin
Christian Graus22-Apr-07 23:09
protectorChristian Graus22-Apr-07 23:09 
QuestionCustom reporting tools [modified] Pin
shreekar22-Apr-07 19:59
shreekar22-Apr-07 19:59 
QuestionWHAT IS THE EQUIVALENT OF THIS CODE IN VB.NET Pin
klaydze22-Apr-07 19:54
klaydze22-Apr-07 19:54 
AnswerRe: WHAT IS THE EQUIVALENT OF THIS CODE IN VB.NET Pin
MatrixCoder22-Apr-07 20:11
MatrixCoder22-Apr-07 20:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.