SQL Server Management Objects

We get the same error in the code below, using either trusted or SQL logins:

VS2010, the console application .NET4, Win XP. SQL2005 Full.

Bombs on the transfer. Data transfer

ERROR: errorCode = -1073548784 description = Request execution "the following error failed:" Getting the COM factory class for components with CLSID {19E353EF-DAF4-45D8-9A04-FB7F7798DCA7} could not be completed with the following error: 80040154. "Possible causes of failure : problems with the request The ResultSet property is set incorrectly, the parameters are not set correctly or the connection is established incorrectly.

it seems like security. Any thoughts would be great!

using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; using System.Collections.Specialized; using System.IO; using System.Configuration; namespace GenerateScripts { class Program { static void Main(string[] args) { ServerConnection sourceConnection = new ServerConnection("localhost"); Server sourceServer = new Server(sourceConnection); //sourceServer.ConnectionContext.LoginSecure = false; //sourceServer.ConnectionContext.Login = "3tier"; //sourceServer.ConnectionContext.Password = "3tier"; Database sourceDatabase = sourceServer.Databases["3tier"]; // destination ServerConnection destinationConnection = new ServerConnection("localhost"); Server destinationServer = new Server(destinationConnection); //destinationServer.ConnectionContext.LoginSecure = false; //destinationServer.ConnectionContext.Login = "3tier2"; //destinationServer.ConnectionContext.Password = "3tier2"; Database destinationDatabase = destinationServer.Databases["3tier2"]; Transfer transfer = new Transfer(sourceDatabase); transfer.CopyAllObjects = false; transfer.DropDestinationObjectsFirst = false; transfer.UseDestinationTransaction = true; transfer.CopyAllDefaults = true; transfer.Options.Indexes = true; transfer.Options.DriAll = true; transfer.CopyAllDefaults = true; transfer.Options.AnsiFile = true; transfer.Options.SchemaQualify = true; transfer.Options.WithDependencies = false; transfer.CreateTargetDatabase = false; transfer.CopySchema = true; transfer.CopyData = true; transfer.DestinationServer = "localhost"; transfer.DestinationDatabase = "3tier2"; transfer.DestinationLoginSecure = false; transfer.DestinationLogin = "3tier2"; transfer.DestinationPassword = "3tier2"; transfer.Options.IncludeIfNotExists = true; transfer.TransferData(); 
+6
c # ssms
source share
1 answer

I don’t know if this is the same case, but I had a similar problem and it was related to corruption of the SQLTaskConnectionOleDb class,

I solved this by running

 regsvr32 "%ProgramFiles%\Microsoft SQL Server\90\DTS\Binn\SQLTaskConnections.dll" 

on the command line.

+2
source share

All Articles