Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

package.Execute fails in VB.net but succeeds in C#.net

Status
Not open for further replies.

JustinEzequiel

Programmer
Jul 30, 2001
1,192
PH
cross-posted at
How come the C# version succeeds when the VB version fails?

Code:
//C#
using System;
using Microsoft.SqlServer.Dts.Runtime;

namespace cs_console_SSIS
{
    class Program
    {
        static void Main(string[] args)
        {
            Application app = new Application();
            Package package2;
            DTSExecResult result2;

            package2 = app.LoadFromSqlServer(
                "\\OHBilling", "C2130001312", "billing", "billing",
null);

            package2.ImportConfigurationFile("D:\\Program Files\
\Microsoft SQL Server\\90\\DTS\\Packages\\SSISOHBilling\
\OHBilling.dtsConfig");

            result2 = package2.Execute();

            Console.WriteLine("Package Execution results: {0}",
                result2.ToString());
        }
    }
}

Code:
' VB
Imports System
Imports Microsoft.SqlServer.Dts.Runtime

Module Module1

    Sub Main()

        Dim app As New Application()
        Dim package2 As Package
        Dim result2 As DTSExecResult

        package2 = app.LoadFromSqlServer( _
            "\OHBilling", "C2130001312", "billing", "billing",
Nothing)

        package2.ImportConfigurationFile("D:\Program Files\Microsoft
SQL Server\90\DTS\Packages\SSISOHBilling\OHBilling.dtsConfig")

        result2 = package2.Execute()

        Console.WriteLine("Package Execution results: {0}", _
            result2.ToString())

    End Sub

End Module
 
To weed out the sily problems first, you added the reference the same way in both projects?

Does the vb method run successfully, just without the desired result? If it errors, what line is it on?

Hope this helps,

Alex



[small]----signature below----[/small]
Majority rule don't work in mental institutions

My Crummy Web Page
 
Out of curiousity, can you check if the VB version runs if you comment out this line (depending upon answers to the first 2 questions):

Code:
package2.ImportConfigurationFile("D:\Program Files\Microsoft
SQL Server\90\DTS\Packages\SSISOHBilling\OHBilling.dtsConfig")

[small]----signature below----[/small]
Majority rule don't work in mental institutions

My Crummy Web Page
 
AlexCuse,

No errors, just not the desired result.

for the VB version, I get
Package Execution results: Failure
with and without the ImportConfigurationFile line

for the C# version, I get
Package Execution results: Success

> added the reference the same way in both projects
will check this and get back to you
 
C#
Microsoft.SqlServer.ManagedDTS
d:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll
Version: 9.0.242.0
Runtime Ver: v2.0.50727

VB
Microsoft.SQLServer.ManagedDTS
d:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll
Version: 9.0.242.0
Runtime Ver: v2.0.50727
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top