Thx for your answer, will try :)
Andrzej Kaczmarczyk wrote:
Hi
I know this is not a direct firebird .net provider related question but I
didn't get an answer on the M$ newsgroups so will try here to, sorry. :)
Is there a way to create lookup columns in tables in the typed datasets?
Like
CityTable
----------
CityID
CityName
Employee
--------
EmployeeID
EmployeeName
City -> foreign key to CityTable.CityID
CityName -> lookup column, will get the value from CityTable according the
City value
First the CityTable records are loaded and then the Employee. I could do
this with SQL but that means I would load the same data 2 times and I'm
trying to lower the network usage as the lines that we are using are slow.
In expression column I was trying to use the Parent keyword but with no
luck. So is there a way to do this?
well, you can do it by hand, it's pretty fast
employeeTable.BeginLoadData();
foreach (TypedDataSet.EmployeeRow employee in employeeTable.Rows) {
employee.CityName = employee.CityRow.Name;
}
employee.EndLoadData();
you can speed this up further by going throught the dataset designer and
skip all the casting
that are along. and if you're going to loads further records (if you batch
loads instead of loading full tables), you can put a employeeTable.Select
instead of Rows
The other solution is to make many-to-many relation and put another table
in-between that way you'll have the children relationships it require
(although I am fairly sertain it should work with parent)
the third is to use LinQ (it is on the microsoft lab page, still in beta,
designed for C# 3.0, but it allow full blown relational queries)
Thx
Zoltan
HTH
CUIN Kaczy
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider