Click here to Skip to main content
15,889,909 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Protect my sql server backup database file Pin
satc3-May-15 20:16
satc3-May-15 20:16 
GeneralRe: Protect my sql server backup database file Pin
Sascha Lefèvre3-May-15 23:25
professionalSascha Lefèvre3-May-15 23:25 
SuggestionRe: Protect my sql server backup database file Pin
Richard Deeming6-May-15 1:32
mveRichard Deeming6-May-15 1:32 
GeneralRe: Protect my sql server backup database file Pin
satc6-May-15 16:48
satc6-May-15 16:48 
QuestionDrag and Drop DatagridViewCell Pin
bellatriks28-Apr-15 21:09
bellatriks28-Apr-15 21:09 
AnswerRe: Drag and Drop DatagridViewCell Pin
Abhinav S28-Apr-15 21:18
Abhinav S28-Apr-15 21:18 
GeneralRe: Drag and Drop DatagridViewCell Pin
bellatriks28-Apr-15 22:49
bellatriks28-Apr-15 22:49 
QuestionList of, Delete records before and after date range. Pin
jkirkerx28-Apr-15 10:25
professionaljkirkerx28-Apr-15 10:25 
I created a List, and populated it with an Invoice number and date.

Now I want to delete all the records before the report start date, and after the report stop date.

So I tried this, and now realize theres no way it can work.
I made a copy of the list, and went through the copy, deleting the record in the original.
Trouble is, the original list gets shorter, and the index I used from the copied list no longer matches.

I not sure what to really do here, or how to handle it. Perhaps the RemoveRange would be better to use.
Looking for ideas, or how to acquire the ranges.
'Stage Six, Remove the records not within the date ranges
Dim tSA As New List(Of invoices_by_SA)()
tSA.AddRange(lSA)

Dim lC As Integer = 0
For Each inv As invoices_by_SA In tSA

    If (DateTime.Compare(inv.InvoiceDate, p_startDate.ToString("MM/dd/yyyy")) < 0) _
        Or (DateTime.Compare(inv.InvoiceDate, p_stopDate.ToString("MM/dd/yyyy")) > 0) Then

        lSA.RemoveAt(lC)

    End If

    lC += 1

Next

AnswerRe: List of, Delete records before and after date range. Pin
Sascha Lefèvre28-Apr-15 10:50
professionalSascha Lefèvre28-Apr-15 10:50 
GeneralRe: List of, Delete records before and after date range. Pin
jkirkerx28-Apr-15 11:45
professionaljkirkerx28-Apr-15 11:45 
GeneralRe: List of, Delete records before and after date range. Pin
Sascha Lefèvre28-Apr-15 12:16
professionalSascha Lefèvre28-Apr-15 12:16 
QuestionRDLC Expression for Address in textbox Pin
jkirkerx27-Apr-15 9:46
professionaljkirkerx27-Apr-15 9:46 
AnswerRe: RDLC Expression for Address in textbox Pin
jkirkerx27-Apr-15 10:45
professionaljkirkerx27-Apr-15 10:45 
QuestionFinding the index of a Listbox item, based on search criteria. VB6 Pin
EdwardX227-Apr-15 6:25
EdwardX227-Apr-15 6:25 
AnswerRe: Finding the index of a Listbox item, based on search criteria. VB6 Pin
Richard MacCutchan27-Apr-15 7:04
mveRichard MacCutchan27-Apr-15 7:04 
GeneralRe: Finding the index of a Listbox item, based on search criteria. VB6 Pin
EdwardX227-Apr-15 12:49
EdwardX227-Apr-15 12:49 
GeneralRe: Finding the index of a Listbox item, based on search criteria. VB6 Pin
Sascha Lefèvre27-Apr-15 15:00
professionalSascha Lefèvre27-Apr-15 15:00 
Questionerror when i run my application Pin
Member 1163064825-Apr-15 5:25
Member 1163064825-Apr-15 5:25 
SuggestionRe: error when i run my application Pin
Richard MacCutchan25-Apr-15 6:42
mveRichard MacCutchan25-Apr-15 6:42 
AnswerRe: error when i run my application Pin
Dave Kreskowiak25-Apr-15 10:54
mveDave Kreskowiak25-Apr-15 10:54 
QuestionRun an exe in MDI_Form Pin
bellatriks24-Apr-15 22:35
bellatriks24-Apr-15 22:35 
AnswerRe: Run an exe in MDI_Form Pin
Dave Kreskowiak25-Apr-15 4:06
mveDave Kreskowiak25-Apr-15 4:06 
QuestionPartial public Sub ??? Pin
satc22-Apr-15 9:41
satc22-Apr-15 9:41 
AnswerRe: Partial public Sub ??? Pin
Sascha Lefèvre22-Apr-15 10:16
professionalSascha Lefèvre22-Apr-15 10:16 
QuestionDataGridView.Column("name").DefaultCellStyle.Format applied to all columns (it shouldn't be) Pin
Johan Hakkesteegt22-Apr-15 3:06
Johan Hakkesteegt22-Apr-15 3:06 

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.