New Posts New Posts RSS Feed: DataTable with the Employee class members
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DataTable with the Employee class members

 Post Reply Post Reply
Author
gussabina View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Nov-2007
Location: United States
Posts: 22
Post Options Post Options   Quote gussabina Quote  Post ReplyReply Direct Link To This Post Topic: DataTable with the Employee class members
    Posted: 19-Nov-2007 at 11:45pm
Hi All:
I would need to create a new DataTable with all datamembers from the Employee class (IdeaBlade Tutorial Database). I mean, just a single table with the employee table data and the related entities , such the home address. It is possible? How to do it?
 
Thanks in Advance!
Gus
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 21-Nov-2007 at 11:54am
Please don't try to use the underlying DataTable from ADO.NET.  This is not a public API that we advertise.  Rather it is an implementation detail that could change in future versions of our product.
 
Developers who are new to DevForce often find it hard to shake old habits and prejudices.  For example, many developers ask us how to create a join of one table with some related tables.  We try to show these developers that joins are quite unnecessary.  Just use the tables as they are and use relations to get the related information.  There are many examples in the tutorials that use complex and interrelated tables, and nowhere do we do any table joins.
 
The question that I would ask you is why do you want to put the data in a single table. For example, to get the Employee's Address, we use a relation.  We use "Employee.Address" and two tables, an Employee table and an Address table.  I think what you want is one table, i.e., an Employee table with an added Address Column.  Note, however, that we still use the same expression to get the Address, i.e., "Employee.Address" so we haven't made it any easier for the developer to write his code, and meanwhile we've added more work for the DBA.  Someone has to create the joined table.
 


Edited by davidklitzke - 21-Nov-2007 at 11:55am
Back to Top
gussabina View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Nov-2007
Location: United States
Posts: 22
Post Options Post Options   Quote gussabina Quote  Post ReplyReply Direct Link To This Post Posted: 22-Nov-2007 at 10:47am
Yes. David:
You are right... The way IdeaBlade handle relations is excellent! The only concerns is that I have to interface with others tools in order to use their presentations tools for reports and so on...An they require just a single table with all the data. So if I have the Employee data and their related data, I would need to be able to copy all this data into just one table...
 
Thanks
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 22-Nov-2007 at 11:22pm
Just make custom properties for your relational properties.  For example, for the home address of an Employee make a custom property name HomeAddress.  Unfortunately, while this will work for some reporting tools like DevExpress XtraReports, it doesn't work for other tools such as Crystal Reports.
 
If you have to work with a reporting tool that won't accept relational properties, you might try using a view.  You can also build a Stored Procedure backed entity that is essentially a join of your Employee table with some other tables. 
 
Just because our first answer to your question was that you shouldn't have to use a join, we do, in fact, work quite nicely with table joins!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down