ASP.net Editing a variable number of items via an API

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I am using the following code to edit two records via an API in ASP.net
I want to change it so that I can add a much larger variable number of edits
Can I use an array for instanceeg Dim DL(10000) as New LineEdit?

                        Dim DLs As New List(Of LineEdit)
                        Dim DL1 As New LineEdit
                        Dim DL2 As New LineEdit
                        DL1.LineID = 2
                        DL1.EmployeeID = 4727
                        DL1.Hours = 14
                        DL1.LogDate = "19 Apr 2019"
                        DL1.LogDate = lblLogDate.Text
                        DL1.EmplyeeWorkType = ddlWorkType.Text
                        DLs.Add(DL1)
                        DL2.LineID = 0
                        DL2.EmployeeID = 4720
                        DL2.Hours = 4
                        DL2.LogDate = "19 Apr 2019"
                        DL2.EmplyeeWorkType = "Work"
                        DLs.Add(DL2)

                        Dim result As String
                        result = PostEmployeeHoursEdit(DLs, DropDownList_Stores.Text)

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can use then same varible:
Dim DLs As New List(Of LineEdit)
Dim DL1 As New LineEdit

DL1.LineID = 2
DL1.EmployeeID = 4727
 DL1.Hours = 14
 DL1.LogDate = "19 Apr 2019"
DL1.LogDate = lblLogDate.Text DL1.EmplyeeWorkType = ddlWorkType.Text DLs.Add(DL1)

DL1 = New LineEdit
DL1.LineID = 0
DL1.EmployeeID = 4720
 DL1.Hours = 4
DL1.LogDate = "19 Apr 2019" DL1.EmplyeeWorkType = "Work" DLs.Add(DL1)
Murray BrownASP.net/VSTO Developer

Author

Commented:
Great answer. Thanks so much

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial