Hi,
Self-servicing with version 2.5.
I have a service running that picks up EDI files sent to us. I now have to cater for files from another territory, so I have a new database on my existing server with a different name but with the exact same schema.
In my service I'm trying to process files from territory 1 first, change my connection and then process files from territory 2 (to go into the new database). At the moment in my dev environment, even though I'm changing the DbUtil.ActualConnectionString, all the records are getting inserted into territory 1 database.
My code is as follows:
string originalConnection = DbUtils.ActualConnectionString;
// do the processing
try
{
// Process ROI files first - no need to change connection string here as it should already be ROI db
ProcessFilesInProcessDirectory(Region.ROI);
// Now change the connection string so the NI files go into the NI database
DbUtils.ActualConnectionString = ConfigurationManager.ConnectionStrings["NIConnectionString"].ConnectionString;
ProcessFilesInProcessDirectory(Region.NI);
}
finally
{
// Set the connection string back to the original ROI one
DbUtils.ActualConnectionString = originalConnection;
}
I had though to change catalogs/connections all that had to be done was to change the connection string, but I'm not having any luck.
Any help is appreciated.
Thanks,
Ciaran.