Click here to Skip to main content
15,886,919 members

Comments by Member 11856456 (Top 189 by date)

Member 11856456 23-Feb-23 21:02pm View    
Thanks, I cant tell any speed difference, however, this did make it more efficient on memory consumption. So, still a win in my book.
Member 11856456 29-Nov-22 7:05am View    
Thank you for the help
Member 11856456 25-Nov-22 6:29am View    
thanks this really helps out.
Member 11856456 25-Nov-22 6:15am View    
Richard, It is not finding the module finance. Dim moduleType As Type = Type.GetType(finance) I am using finance as a string variable. is this supposed to be something else? Maybe a specific object, or should a string variable work?
Member 11856456 22-Nov-22 10:25am View    
I am still at a loss, I even have looked into linq to help solve the issue. But I cant figure out how to code the linq query correctly.

the query has to be set up so that SSN or Individual_ID is sorted first, the list of(EMployee, Spouse, Partner, Child) is second, then last_name, and finally first_name.





Dim anyHasValue = Demographic_data_view.Rows.
OfType(Of DataGridViewRow).
Where(Function(r) Not r.IsNewRow AndAlso r.Cells.
OfType(Of DataGridViewTextBoxCell).
Any(Function(c) c.OwningColumn.Index = col AndAlso
If(c.Value, String.Empty).ToString().Trim().Length > 0)).
Any()

'this line of code allows you to sort a range of columns that contain the data
If anyHasValue = True Then
sort_str = "Employee_SSN ASC, "
'sort_str = "Employee_SSN"
Else
'Sort by individual ID column
sort_str = "Individual_ID ASC, "
'sort_str = "Individual_ID"
End If

'.SortFields.Add Key:=Range("H10:H" & vRowc), SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:="Employee,Spouse,Child,"

'the excel sortfilds will be converted over to vb.net as text values incorportated into the sort_str variable
dt.DefaultView.Sort = sort_str + " Last_name ASC, First_name ASC, Benefit_type ASC"
dt = dt.DefaultView.ToTable()


'Dim order As List(Of String) = New List(Of String)() From {
' "Employee",
' "Spouse",
' "Partner",
' "Child"
'}
'Dim query = From item In order Join row In individual.dt.AsEnumerable() On item Equals row.Field(Of String)("Relationship") Select row
'Dim result = query.CopyToDataTable()
'Demographic_data_view.DataSource = result