Options to display fields from different databases in WPF DataGrid?

I am using .Net 4.0 framework, C#, WPF, EF 4 and FireBird.

I have some data (a multi-field customer number) in a datagrid that comes from a table in one FireBird database. In a second FireBird database I have a table which contains some more information (the customer number again, along with the customer name) that I need to appear in the grid. There are no more than a thousand rows in the tables.

If the tables were in the same database this would be trivial. However, because the FireBird database I'm using does not support cross-database joins, I believe I'll have to join the data at the application level.

Currently I'm displaying only the key values in the grid, but I need to show the customer name from the second database as well. I'm binding the datagrid to list<> produced by a LINQ query against the EF.

I thought that I might set up a second EF model for the second database, and then modify the LINQ query to combine the contents of the two tables into an anonymous class with the required fields.

I'm not sure what other options might be available for doing this.

I could also eliminate the problem by pushing the required table from the second database into the first so that a SQL join can be used. This would have to be done elsewhere in the system and might end up being the preferred solution, but I don't want to go there without evaluating other solutions first.

Answers


I went ahead and set up a second entity model against the second database. I set up a class to contain the entity model instances and handle the cross-database interactions (some of this is done with properties on partial classes to model entities). The model view treats the data essentially as a single database. When we get around to moving this stuff into SQL server and getting rid of the dual-database junk the application itself won't have to change much.

The only problem I've run into so far is that I have to be careful when setting up linq queries, combining entities from the two models in one query sometimes generates errors. Not hard to work around though.


Need Your Help

Django max_length value for a character verying row

django postgresql varchar

So I have this pre-existing database that I'm trying to connect to using Django and I've already introspected the database and I'm just cleaning up the models before actually doing anything, and I'...

How to group an object by its associated model when using a has_many :through relationship in rails?

ruby-on-rails activerecord associations ruby-on-rails-4 has-many-through

I am working on an application that helps a local restaurant track the hours worked each day. The user enters data through a model called a "Checkout" at the end of each shift. They select an emplo...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.