How to join tables in 2 different databases?

Hi Jatin,

Normally when bound to a database, filtering will use IQueryable (Linq to SQL) and the operation will be executed by the database server while in this case (not mapped property from other source) filtering will be server-side in-memory (Linq to Objects). In the first setup case sensitivity depends completely on the database settings while in the second setup case sensitivity depends on equality operators used by IComparer implementations.

The best way to handle this will be to create custom function for the filters client-side to force the case to be lower case for this column only before send it to the server:

import { Component, Injector } from '@angular/core';
import { OrdersGenerated } from './orders-generated.component';

@Component({
  selector: 'page-orders',
  templateUrl: './orders.component.html'
})
export class OrdersComponent extends OrdersGenerated {
  constructor(injector: Injector) {
    super(injector);
  }

  onFilter(filter) {
    return filter
      .replace(/SampleOrder\/UserName/g, 'tolower(SampleOrder/UserName)') // wrap the property with tolower() function
      .replace(/'(.*?)'/, "tolower('$1')"); // wrap the value with tolower() function
  }
}

Best Regards,
Vladimir

PS: I've used new Sample.Order.UserName property (instead Sample.OrderDetails.Quantity) from the other database just to illustrate string operations. Of course all these can be replaced by simply creating new SQL View where you can join the tables.

1 Like