Click here to Skip to main content
15,028,618 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Active Directory question Pin
Dave Kreskowiak8-May-07 10:36
mveDave Kreskowiak8-May-07 10:36 
GeneralRe: Active Directory question Pin
Psycho-*Coder*-Extreme8-May-07 11:07
MemberPsycho-*Coder*-Extreme8-May-07 11:07 
QuestionHow to make a program that is able to save data ? Pin
Me0w!8-May-07 8:13
MemberMe0w!8-May-07 8:13 
AnswerRe: How to make a program that is able to save data ? Pin
Dave Kreskowiak8-May-07 8:16
mveDave Kreskowiak8-May-07 8:16 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 8:58
MemberMe0w!8-May-07 8:58 
GeneralRe: How to make a program that is able to save data ? Pin
Dave Kreskowiak8-May-07 10:05
mveDave Kreskowiak8-May-07 10:05 
GeneralRe: How to make a program that is able to save data ? Pin
Me0w!8-May-07 10:21
MemberMe0w!8-May-07 10:21 
QuestionDeleting multiple rows Pin
TAK788-May-07 8:00
MemberTAK788-May-07 8:00 
I'm working on a shoppingCart and try to delete multiple rows at once, but get error message:
"Collection was modified; enumeration operation may not execute."

Here is my code:

Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
For Each row As GridViewRow In GridView1.Rows
Dim chk As CheckBox = CType(row.FindControl("Remove"), CheckBox)
If Not chk Is Nothing AndAlso chk.Checked Then
Dim ID = New Guid(GridView1.DataKeys(row.RowIndex).Value.ToString())
StoreManager.RemoveItem(ID)
End If
Next

End Sub

Code for:
Class StoreManager

Public Shared Sub RemoveItem(ByVal id As Guid)
ShoppingCart.Remove(id)
End Sub

Code for:
Class ShoppingCart

Public Sub Remove(ByVal id As Guid)
For Each existingProd As OrderedProducts In _items
If id = existingProd.ID Then
_items.Remove(existingProd)
End If
Next 'error calls this line!!!
End Sub


Not sure how to fix error!
AnswerRe: Deleting multiple rows Pin
Dave Kreskowiak8-May-07 8:13
mveDave Kreskowiak8-May-07 8:13 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:39
MemberTAK788-May-07 8:39 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:53
MemberTAK788-May-07 8:53 
Questionsearch hard drive for files Pin
jds12078-May-07 7:36
Memberjds12078-May-07 7:36 
AnswerRe: search hard drive for files Pin
MatrixCoder8-May-07 7:59
MemberMatrixCoder8-May-07 7:59 
AnswerRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 8:10
mveDave Kreskowiak8-May-07 8:10 
GeneralRe: search hard drive for files Pin
jds12078-May-07 10:21
Memberjds12078-May-07 10:21 
GeneralRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 10:32
mveDave Kreskowiak8-May-07 10:32 
GeneralRe: search hard drive for files Pin
Dave Kreskowiak8-May-07 17:24
mveDave Kreskowiak8-May-07 17:24 
GeneralRe: search hard drive for files Pin
P P Vilsad8-May-07 21:21
MemberP P Vilsad8-May-07 21:21 
AnswerRe: search hard drive for files Pin
P P Vilsad8-May-07 21:18
MemberP P Vilsad8-May-07 21:18 
QuestionStart up Pin
scorp_scorp8-May-07 7:23
Memberscorp_scorp8-May-07 7:23 
AnswerRe: Start up Pin
MatrixCoder8-May-07 7:55
MemberMatrixCoder8-May-07 7:55 
AnswerRe: Start up Pin
nlarson118-May-07 7:58
Membernlarson118-May-07 7:58 
QuestionDataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 4:26
MemberRichardBerry8-May-07 4:26 
AnswerRe: DataGridView - Display Row Numbers on Control Pin
Rupesh Kumar Swami8-May-07 5:27
MemberRupesh Kumar Swami8-May-07 5:27 
GeneralRe: DataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 7:43
MemberRichardBerry8-May-07 7:43 

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.