Testing configuration for connections in SSIS 2005 packages - configuration

I am trying to make a test that loops through all our ssis 2005 packages and identify if any connections are using incorrect servernames.
In the packages we have two connections that should be linked to one configuration in a sql server table.
In the configuration table there are two rows with different package paths but the same configuration name. When I read the package programatically I can't find any link between the connections and the configurations and the connections seem to show the "local" connectionstring before the configurations has taken effect. Is there any way that I can get the connectionstrings that will be used when the package is run or find the link between the connection and the configuration?
Here is the code that I am debugging:
string path = #"C:\Package1.dtsx";
Microsoft.SqlServer.Dts.Runtime.Application app = new
Microsoft.SqlServer.Dts.Runtime.Application();
Package p;
p = app.LoadPackage(path, null);
Config part of file:
<DTS:Configuration>
<DTS:Property DTS:Name="ConfigurationType">7</DTS:Property>
<DTS:Property DTS:Name="ConfigurationString">"BI_MR_Native";"[MetaGrensesnitt].[PakkeKonfigurasjon]";"Test_ConnectionString";</DTS:Property>
<DTS:Property DTS:Name="ConfigurationVariable"></DTS:Property>
<DTS:Property DTS:Name="ObjectName">Test_Connectionstring</DTS:Property>
<DTS:Property DTS:Name="DTSID">{47CA3739-654E-48E5-9B3A-0DE8711127D9}</DTS:Property>
<DTS:Property DTS:Name="Description"></DTS:Property>
<DTS:Property DTS:Name="CreationName"></DTS:Property>
</DTS:Configuration>
Contents of our configuration table for this configuration:
http://i.stack.imgur.com/dsopz.jpg

Related

BIML generation with Application Intent=ReadOnly

I create a package through BIML.
Source - MS SQL. (Native OLE DB\SQL Source Native Client 11.0 )
Connection to the source is only possible using "Application Intent=ReadOnly".
Connection string example in BIML:
<Connection Name="servername.dbname.user" ConnectionString="Data Source=servername;User ID=user;Password='pass'; Initial Catalog=dbname;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=False;Application Intent=readonly;" />
</Connections>
When generating, I get the following error:
1/1 Emitting Project ORD.dtproj.
1/3 Emitting Package Upload sad_pda.
Error 0 FlowFramework, Version=5.0.64108.0, Culture=neutral, PublicKeyToken=015f370a62f9a1a3. Node OLE DB Source: Could not execute Query on Connection servername.dbname.user:
**** TEXT MY QUERY
The target database ('dbname') is in an availability group and is currently accessible for connections when the application intent is set to read only. For more information about application intent, see SQL Server Books Online. -1 -1
P.S.
If you make the package manually in Visual Studio, it works.
Let's convert this package to BIML. Trying to create an SSIS package from BIML - attract this same error.

Load package from SQL Server

I used following article to execute SSIS package parallel.https://www.sqlservercentral.com/articles/importing-files-in-parallel-with-ssis. In this article it explained execute a package from a folder location. In my situation I am deploying both packages. I tried following code:
Application app = new Application();
Package pkg = app.LoadFromSqlServer(dtsxPackage, "localhost",null, null, null);
I am getting error
Cannot find folder "Package name"
Package deployment is as follows.
Using "ParallelExecusion.dtsx" I am try to execute the "FileSync.dtsx" package. I am setting the package path as "FileSync\TeamR\FileSync.dtsx"
The code shown is for loading a package that is stored in the SQL Server database named msdb. It will use the binaries in sys.dtspackages90 or sys.ssispackages (table names approximate) but that only works for packages developed and deployed under the Package Deployment Model (2005-2008R2) or projects that are explicitly defined as such for SQL Server 2012+
What your screenshot shows is a Project Deployment Model which is a .ispac deployed to the SSISDB database. While that package is on SQL Server, you do not use the LoadFromSqlServer method. Instead, you're going to use the same-ish methods that the CLR methods in the database use.
CreateSsisServerExecution
Set any Parameter/Property values
Start
Personally, unless I had a strong use case that I needed to control every aspect of the package execution, I'd just use TSQL here (and remove class dependencies in your code) to Execute SSIS Packages

SSMS 2014 Service provider must implement IVsDebugger interface

I'm getting the following errors when launching Microsoft SQL Server Management Studio 2014.
The 'VsDebugPresentationPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' package did not load correctly.
The 'Microsoft.SqlServer.Management.SqlStudio, Microsoft.SqlServer.Management.SqlStudio, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:\Users\Leah\AppData\Roaming\Microsoft\AppEnv\10.0\ActivityLog.xml'.
I have checked the ActivityLog.xml and have found the following errors:
<entry>
<record>1063</record>
<time>2016/09/09 10:51:43.711</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Microsoft.SqlServer.Management.SqlStudio, Microsoft.SqlServer.Management.SqlStudio, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91]</description>
<guid>{04401FF3-8B0F-4D2D-85EB-2A3542867A8B}</guid>
<hr>80070057 - E_INVALIDARG</hr>
<errorinfo>Service provider must implement IVsDebugger interface</errorinfo>
</entry>
<entry>
<record>1064</record>
<time>2016/09/09 10:51:43.714</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Microsoft.SqlServer.Management.SqlStudio, Microsoft.SqlServer.Management.SqlStudio, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91]</description>
<guid>{04401FF3-8B0F-4D2D-85EB-2A3542867A8B}</guid>
<hr>80070057 - E_INVALIDARG</hr>
<errorinfo>Service provider must implement IVsDebugger interface</errorinfo>
</entry>
This message has started appearing today after my PC black screened during windows updates. After several more black screens and further forced restarts, windows restored to a previous version and booted successfully. I have tried doing a fresh install of Microsoft SQL Server Management Studio 2014 but it hasn't changed the outcome.
This is the update that caused the black screens: Feature update to Windows 10, version 1607
Any help welcomed. Thanks.
Yes, it wasn't related to the update. My machine.config wasn't correct as I had put the connection string above config section in the machine.config.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

Visual Studio settings files corrupt / MySQL connection issues

My Visual Studio 2012 Professional is having problems with a three project solution.
I have been struggling all day with a LinqToMySQL.edmx file and getting a MySQL data connection option to appear in Server Explorer.
For this I have tried installing EFTools6.1.0ForVS2012. The mysql connector I have tried is mysql-connector-net-6.7.4. This worked at one point but other problems with MySQL dll versions means I am back to square one (when I got the latest version of the DLL which I got from nuGet 6.8.3, it was still looking for 6.7.4). I have since got 6.7.4 and added the reference to the dll for all project. I've also tried editing machine.config to look for the correct mysql data provider. Still no joy.
But now...
For each solution the app.config or web.config files can't be read when trying to access Properties > Settings.
An error occurred while reading the app.config file. The file might be
corrupted or contain invalid XML
All files seem valid when checked under an XML validator.
When opening a project in VS2012 I get the error:
Microsoft Visual Studio
The ProviderPackage package did not load correctly.
The problem may have been caused by a configuration change
or by the installation of another extension. You can get more
information by examining the file
t:\Users\John\AppData\Roaming\Microsoft\VisualStudio\11.0\A
ctivityLog.xml.
When trying to create a new project I get:
Failed to create a 'ImageSource' from the text
'..\lmages\Medium.png'.
After re-installing Visual Studio the problem persists.
In the activity log the last errors are:
<entry>
<record>235</record>
<time>2014/03/25 10:28:31.202</time>
<type>Warning</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>The catalog cache file is not up-to-date and has to be regenerated:</description>
<path>C:\Users\John\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache\Microsoft.VisualStudio.Default.cache</path>
</entry>
<entry>
<record>236</record>
<time>2014/03/25 10:28:31.211</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual Studio Component Model Host Package]</description>
<guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
<hr>80131902</hr>
<errorinfo>Configuration system failed to initialize</errorinfo>
</entry>
<entry>
<record>237</record>
<time>2014/03/25 10:28:31.241</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual Studio Component Model Host Package]</description>
<guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
<hr>80131902</hr>
<errorinfo>Configuration system failed to initialize</errorinfo>
</entry>
Looks like most of these errors were caused by malformed XML in the machine.config file in the framework folder. The machine.config file in framework64 was fine which must have caused me confusion. That's what editing with notepad gets you!
Still having problems with the mysql connector but that's a separate issue.

Shared Hosting + Entity Framework + MySQL = Data Provider Errors?

long-time listener, first-time caller!
I’m trying to connect to MySQL using the ADO.NET Entity Framework. (Visual Studio 2010, .NET 4.0) I created a web project and another class library project to serve as my DAL. On my local machine, I have no problems, and I have also tried running with Medium trust. I’m able to fully control the db as expected.
When I deploy to my host (shared, medium trust) however, I keep getting errors. I have tweaked my web.config multiple ways: I’ve explicitly called my assembly in the connection string, I’ve used the wildcard mapping, I added references to the MySQL dll’s, etc.
<connectionStrings>
<add name="NamespaceContext" connectionString="metadata=res:// Namespace.Data.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null/DataModel.csdl|res:// Namespace.Data.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null/DataModel.ssdl|res:// Namespace.Data.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null/DataModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=myserver;User Id=user;database=thedatabase;password=password;Persist Security Info=True"" providerName="System.Data.EntityClient"/>
<add name=" NamespaceContext " connectionString="metadata=res://*/;provider=MySql.Data.MySqlClient;provider connection string=" server=myserver;User Id=user;database=thedatabase;password=password;Persist Security Info=True"" providerName="System.Data.EntityClient"/>
<add name=" NamespaceContext " connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=MySql.Data.MySqlClient;provider connection string=" server=myserver;User Id=user;database=thedatabase;password=password;Persist Security Info=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
The error I keep getting is:
System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. --->
System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at MyNamespace.Web.Html.TestPage.EntityFrameworkTestButton_Click(Object sender, EventArgs e)
I talked to their support guys (who aren’t devs) but they said the MySQL connector is installed and in the GAC. I tried to use the DbProviderFactories section in my web.config, like the following:
<system.data>
<DbProviderFactories>
<clear/>
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data>
I was hoping I could control this and reference the provider in my project. I then receive the following error:
System.Data.MetadataException: Schema specified is not valid.
Errors: error 0194: All artifacts loaded into an ItemCollection must have the same version. Multiple versions were encountered.
MySql.Data.Entity.Properties.SchemaDefinition-6.0.ssdl(4,9) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '5' is different from '5.0' that was encountered earlier.
error 0194: All artifacts loaded into an ItemCollection must have the same version.
(lots of the same error message was snipped for brevity)
I am at a complete loss. I tried strongly signing my DAL project, not using a DAL and just creating the .edmx in the web project, all to no avail. I could have sworn I got it working at some point, but perhaps I was delirious.
Sorry for the wall o' text. Can anyone help or shed some light?
Thanks!
What happens if you put the mysql dll in your bin folder? Alternatively, try to remove the version restriction on the mysql dll, they may not have that exact version loaded on their servers.
I had a very similar problem in my application, where I was using the MySQL connector for a MySQL database and the Entity Framework for a SQL Server database (two separate connections, one project). The MySQL.Data.Entity DLL seems to fight with the entity framework. I didn't actually need it so I removed it... but the error persisted!
Finally out of desperation I just deleted my bin and obj folders and recompiled. Problem solved. I guess something was cached or hanging around in my folders, even after I ran a clean and rebuild. Something to try anyways if someone else runs into this.