Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 ASP.NET and Integration Services

Author  Topic 

luislc
Starting Member

2 Posts

Posted - 2010-02-27 : 19:16:17
Hello everybody.
I'm developing an ETL with Integration Services (SQL Server 2005) and ASP.NET(it's the GUI)(Visual Studio.NET 2005).

While I'm testing inside Visual Studio.NET all is ok but when I put the ASP.NET application into the localhost (with the installer) I get an error.

My problem is with the next line:


Dim DTSReader As System.Data.SqlClient.SqlDataReader =DTSCmd.ExecuteReader(Data.CommandBehavior.Default)


The error is an system.nullreference.exception.

I don't think that the problem is in the code because if I change the line to:


Dim DTSReader As System.Data.SqlClient.SqlDataReader = Nothing


I get the same error inside Visual Studio.NET


I think that the problem is in the steps to put the ASP.NET application into the localhost or may be the dtsx package.

Can you help me?

Thank you very much

I attach here all the code.


Imports Microsoft.SqlServer.Dts.DtsClient

Imports System.Data.SqlClient
Partial Class _Default

Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

connectToSSISPackage("C:\Andy\584350_SQL SSIS\Demos\Ch17\Actual\SSIS_ASP_Feeder\SSIS_ASP_Feeder\bin\Package.dtsx")

End Sub

Private Function connectToSSISPackage(ByVal path As String) As Integer
Dim ssisCN As DtsConnection = New DtsConnectionssisCN.ConnectionString = String.Format("-f ""{0}""", path)

ssisCN.Open()

Dim ssisCmd As DtsCommand = New DtsCommand(ssisCN)

ssisCmd.CommandText = "DataReaderDest"

Dim ssisReader As Data.IDataReader = ssisCmd.ExecuteReader(Data.CommandBehavior.Default)

Dim ssisDs As Data.DataSet = New Data.DataSet

ssisDs.Load(ssisReader, Data.LoadOption.OverwriteChanges, ssisReader.GetSchemaTable().TableName)

GridView1.DataSource = ssisDs

GridView1.DataBind()

ssisCN.Close()
End Function

End Class

   

- Advertisement -