1
我有兩個不同的數據庫,它們在某些列中具有相同的屬性。 我的存儲庫的目標是獲取這些屬性並進行比較。在ADO.NET中比較來自不同數據庫的兩個數據讀取器
所以,我就是這麼做的:
public sealed class Product
{
public string BarCode{ get; set; }
public string CreationDate{ get; set; }
public string Modifier{ get; set; }
public string Status { get; set; }
}
public IEnumerable<Product> GetProductsDB1()
{
// ADO.NET stuff using DataReader returning a Product List from DB1
}
public IEnumerable<Product> GetProductsDB2()
{
// ADO.NET stuff using DataReader returning a Product List from DB2
}
public IEnumerable<Product> Compare()
{
var db2 = GetProductsDB2()
var db1 = GetProductsDB1()
//Comparing both lists here and returning the result list to display in GridView
}
林不知道,如果是做的最好的辦法。我希望有任何建議可以使用正確的概念來做到這一點。因爲這種比較是痛苦的,我有超過30個對象來做同樣的事情。
謝謝。
世界上沒有唯一標識符。是的,這些產品存在於同一個列表中。 – gog
你希望做什麼比較呢? – Matt
在流程工作流程中,產品在這兩個第三部分數據庫中同時添加,但有時數據已損壞且值不相同。所以我需要檢查它並顯示。 – gog