OK, that took care of the compile problem. I did not come across the documentation that said to set it there instead of setting the property. I would have thought that since it was a property is should have worked.
But it still doesn't work.
Below I am trying to demonstrate a data dump from identical tables from 2 databases MDP_GEP, and MDP_DPC. (GEP and DPC are chemical plants located in the US.) I find it very strange that I am specifying the connection string and yet the same database is being accessed. I am sure this situation is referenced in overwriting the catalog name, but that is done in the app.confg file, which I will not be using. Why doesn't this work and what is the work around.
Code Below,
static void Main(string[] args)
{
RelationPredicateBucket filter = new RelationPredicateBucket(Loops_tbFields.Unit_id == 31);
EntityCollection<Loops_tbEntity> loops = new EntityCollection<Loops_tbEntity>();
string CS = "data source=HOUIC-S-7039\\MDPROONLINE,1474;initial catalog=MDP_GEP;User ID==******;Password==******;persist security info=False;packet size=4096";
using (DataAccessAdapter adapter = new DataAccessAdapter(CS))
{
adapter.FetchEntityCollection(loops, filter);
}
Console.WriteLine("Number of Entities fetched: {0}", loops.Count);
foreach (Loops_tbEntity l in loops)
{
Console.WriteLine("{0} {1}", l.Loop_id, l.LoopName_txt);
}
string s = Console.ReadLine();
RelationPredicateBucket filter2 = new RelationPredicateBucket(Loops_tbFields.Unit_id == 31);
EntityCollection<Loops_tbEntity> loops2 = new EntityCollection<Loops_tbEntity>();
string CS2 = "data source=HOUIC-S-7039\\MDPROONLINE,1474;initial catalog=MDP_DPC;User ID=******;Password==******;persist security info=False;packet size=4096";
using (DataAccessAdapter adapter2 = new DataAccessAdapter(CS2))
{
adapter2.FetchEntityCollection(loops2, filter2);
}
Console.WriteLine("Number of Entities fetched: {0}", loops2.Count);
foreach (Loops_tbEntity l2 in loops2)
{
Console.WriteLine("{0} {1}", l2.Loop_id, l2.LoopName_txt);
}
s = Console.ReadLine();
}