Click here to Skip to main content
15,891,943 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
Psycho-*Coder*-Extreme8-May-07 11:07 
QuestionHow to make a program that is able to save data ? Pin
Me0w!8-May-07 8:13
Me0w!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
Me0w!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
Me0w!8-May-07 10:21 
QuestionDeleting multiple rows Pin
TAK788-May-07 8:00
TAK788-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
TAK788-May-07 8:39 
GeneralRe: Deleting multiple rows Pin
TAK788-May-07 8:53
TAK788-May-07 8:53 
Questionsearch hard drive for files Pin
jds12078-May-07 7:36
jds12078-May-07 7:36 
AnswerRe: search hard drive for files Pin
MatrixCoder8-May-07 7:59
MatrixCoder8-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
jds12078-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
P P Vilsad8-May-07 21:21 
AnswerRe: search hard drive for files Pin
P P Vilsad8-May-07 21:18
P P Vilsad8-May-07 21:18 
QuestionStart up Pin
scorp_scorp8-May-07 7:23
scorp_scorp8-May-07 7:23 
AnswerRe: Start up Pin
MatrixCoder8-May-07 7:55
MatrixCoder8-May-07 7:55 
AnswerRe: Start up Pin
nlarson118-May-07 7:58
nlarson118-May-07 7:58 
QuestionDataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 4:26
RichardBerry8-May-07 4:26 
AnswerRe: DataGridView - Display Row Numbers on Control Pin
Rupesh Kumar Swami8-May-07 5:27
Rupesh Kumar Swami8-May-07 5:27 
GeneralRe: DataGridView - Display Row Numbers on Control Pin
RichardBerry8-May-07 7:43
RichardBerry8-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.