I have the following code:
using System;
using System.Linq;
using FirebirdSql.Data.FirebirdClient;
using System.Configuration;
using System.Data;
namespace TblCliente
{
public class Program
{
static void Main(string[] args)
{
FbConnection fbConnectionPrincipal = new FbConnection
{
ConnectionString = ConfigurationManager.ConnectionStrings["strFirebirdPrincipal"].ToString()
};
FbConnection fbConnectionSecundaria = new FbConnection
{
ConnectionString = ConfigurationManager.ConnectionStrings["strFirebirdSecundaria"].ToString()
};
FbDataAdapter fbDataAdapterPrimario = new FbDataAdapter("SELECT * FROM PRODUTO WHERE PRODUTO.CODPROD = '000399'", fbConnectionPrincipal);
FbDataAdapter fbDataAdapterSecundario = new FbDataAdapter("SELECT * FROM PRODUTO WHERE PRODUTO.CODPROD = '000399'", fbConnectionSecundaria);
DataTable dataTableP = new DataTable();
DataTable dataTableS = new DataTable();
fbDataAdapterPrimario.Fill(dataTableP);
fbDataAdapterSecundario.Fill(dataTableS);
dataTableP.Merge(dataTableS);
var Produto = dataTableP.AsEnumerable().Distinct();
Console.ReadKey();
}
}
}
This code returns results from two distinct databases and included in DataSet
different, after that I made a DataSet.Merge
and on it different values were returned.
How do I include these distinct lines in a new database?