hi all
code below is belong to a procedure , its goal is to receve a dataset and a structure and then copy the dataset's fields into structure's same fieilds .
fields name and Fields datattype in dataset and structure are similar
problem is that
f.SetValue(MyObject, NewAmount)
dont work atall, (Amount) variable is present but it dont place inside
MyObject ,
please help me to correct the error
ds : the dataset
Stru_Employee : the structure that should be initialize
Dim ItemCounter As Integer
ItemCounter = 0
Dim MyObject As New Stru_Employee
For Each f As System.Reflection.FieldInfo In GetType (Stru_Employee).GetFields
Dim Amount = ds.Tables(0).Rows(0).Item(ItemCounter)
f.SetValue(MyObject, Amount)
ItemCounter = ItemCounter + 1
Next
code below is belong to a procedure , its goal is to receve a dataset and a structure and then copy the dataset's fields into structure's same fieilds .
fields name and Fields datattype in dataset and structure are similar
problem is that
f.SetValue(MyObject, NewAmount)
dont work atall, (Amount) variable is present but it dont place inside
MyObject ,
please help me to correct the error
ds : the dataset
Stru_Employee : the structure that should be initialize
Dim ItemCounter As Integer
ItemCounter = 0
Dim MyObject As New Stru_Employee
For Each f As System.Reflection.FieldInfo In GetType (Stru_Employee).GetFields
Dim Amount = ds.Tables(0).Rows(0).Item(ItemCounter)
f.SetValue(MyObject, Amount)
ItemCounter = ItemCounter + 1
Next