Foreign Key Field Description


Author
Message
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

I have table employee (EmployeeBO) with field

employeeNo, employeeName.



I have txn table sale (SalesBO) with field

SalesNo, Date, EmployeeNo, Qty, Price, Total



I would like like to list table employee in editable GridView with columns



SalesNo, Date, EmployeeNo, EmployeeName, Qty, Price, Total



In order to achieve this, I added custom bindable field - EmployeeName to SalesBO, and retrieve it from employeeTable whenever required. I found that it is really killing my application performance.



May I know how should I amend it to get back performance?



Thank you

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
ChanKK (06/17/2010)
...In order to achieve this, I added custom bindable field - EmployeeName to SalesBO, and retrieve it from employeeTable whenever required. I found that it is really killing my application performance.



May I know how should I amend it to get back performance?




Yes a custom field property may affect performance if you need to deal with a lot of records. I get around that by using a custom fill method with a JOIN to bring the desired field with an alias "cfp_EmployeeName", then I will create the custom field property (you already have it), but with code to just return the column value like this:




BusinessFieldDisplayInEditor(), _

Description("Employee Name"), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property [cfp_EmployeeName]() As System.String

Get

Dim loValue As Object

loValue = Me.CurrentRow.Item("cfp_EmployeeName")

If loValue Is DBNull.Value Then

Return String.Empty

Else

Return CType(loValue, System.String).Trim()

End If

End Get

End Property





This way you can continue to use the Custom Field Property in the designers and just need to make sure that the source SQL will have that column "cfp_EmployeeName".

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search