Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Friday, March 30, 2012

How to execute a SSIS dtsx package from an asp.net 2.0 application?

I have a SSIS package that I want users to be able to execute by clicking a button on an a web page. The package does not require any parameters to be passed to it. Previously I've executed DTS packages without any problems but after a fair bit of investigation and trawling the net I've not found a way to do this successfully with SSIS. Some code I've tried -

 Dim app As New Application() ' ' Load package from file system ' Dim package As Package = app.LoadPackage("c:\ssis\Package.dtsx", Nothing) 'package.ImportConfigurationFile("c:\ExamplePackage.dtsConfig") 'Dim vars As Variables = package.Variables 'vars("MyVariable").Value = "value from c#" Dim result As DTSExecResult = package.Execute() lblResult.Text = "Package Execution results: {0} " & result.ToString()

All I get is a message 'Failure'.

Does anyone have an example of how to do this?

Your requirement is different and you are doing in wrong way. The mentioned code run the package on the same machine.

http://blogs.msdn.com/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1801974&SiteID=1

|||

ok I've gone for option number 3 on your first link which uses a webservice to execute the package and then I can run the webservice through my asp.net page.

http://msdn2.microsoft.com/en-us/library/ms403355.aspx

This is my webservice - the example taken from that page,

<WebMethod()> _Public Function LaunchPackage( _ByVal sourceTypeAs String, _ByVal sourceLocationAs String, _ByVal packageNameAs String)As Integer'DTSExecResultDim packagePathAs String Dim myPackageAs PackageDim integrationServicesAs New Application' Combine path and file name. packagePath = Path.Combine(sourceLocation, packageName)Select Case sourceTypeCase"file"' Package is stored as a file. ' Add extension if not present.If String.IsNullOrEmpty(Path.GetExtension(packagePath))Then packagePath =String.Concat(packagePath,".dtsx")End If If File.Exists(packagePath)Then myPackage = integrationServices.LoadPackage(packagePath,Nothing)Else Throw New ApplicationException( _"Invalid file location: " & packagePath)End If Case"sql"' Package is stored in MSDB. ' Combine logical path and package name.If integrationServices.ExistsOnSqlServer(packagePath,".",String.Empty,String.Empty)Then myPackage = integrationServices.LoadFromSqlServer( _ packageName,"(local)",String.Empty,String.Empty,Nothing)Else Throw New ApplicationException( _"Invalid package name or location: " & packagePath)End If Case"dts"' Package is managed by SSIS Package Store. ' Default logical paths are File System and MSDB.If integrationServices.ExistsOnDtsServer(packagePath,".")Then myPackage = integrationServices.LoadFromDtsServer(packagePath,"localhost",Nothing)Else Throw New ApplicationException( _"Invalid package name or location: " & packagePath)End If Case Else Throw New ApplicationException( _ "Invalid sourceType argument: valid values are'file', 'sql', and 'dts'.")End Select Return myPackage.Execute()

and my asp.net page

Protected Sub btnBuildDW_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles btnBuildDW.Click ExecutePackage()End Sub Protected Sub ExecutePackage()Dim launchPackageServiceAs New SCCBuildDW.SCCBuildDWDim packageResultAs Integer Try packageResult = launchPackageService.LaunchPackage("file","c:\ssis","Package")Catch exAs Exception' The type of exception returned by a Web service is: ' System.Web.Services.Protocols.SoapException lblResult.Text ="The following exception occurred: " & ex.MessageEnd Try lblResult.Text = packageResult.ToString'CType(packageResult, PackageExecutionResult).ToString ' Console.ReadKey()End Sub Private Enum PackageExecutionResult PackageSucceeded PackageFailed PackageCompleted PackageWasCancelledEnd Enum

I'm getting PackageFailed. The webservice runs and returns 1 - which must be PackageFailed.

Any ideas what I'm doing wrong? The webservice is using windows authentication and the folder the package is in has Everyone Full Control.

|||

I've made some progress. It was failing due to permissions, I've altered these and can now execute a package containing a stored procedure. However my original package runs a stored procedure and then an Analysis Services Task. This still fails - I've checked the user is a member of the role that has access to run the task.

Is there something else I need to do?

|||

I'm still stuck on this - can anyone offer any help?

|||

I have this working now on my local machine. As soon as I move it to the live server I get PackageFailed when I attempt to run it. Has anyone experienced similar problems?

Given the amount of information on the internet I'm beginning to think I'm the only one who wants to execute SSIS in ASP.NET!

|||

i have similar issues too. maybe running ssis dtsx package using web services is not a good idea at all. especially if we run into so many authentication issues.

what about using sql server agent to run ssis package!

|||

I'm now using a stored procedure to execute the package and this works without problems.

Details of my code can be found here -http://forums.asp.net/p/1149972/1873190.aspx#1873190

|||

I'm also having the same problems you have described. I don't have the option of executing from a stored procedure.

I noticed that when I use the <identity impersonate="true"> and specified the username and password, that I got much further, but the package still fails.

I'm guessing that I'll probably end up adjusting the permissions on certain directories and so forth until this works.

|||

Hi all,

this might be useful.

http://www.codeproject.com/useritems/CallSSISFromCSharp.asp?df=100&forumid=309846&exp=0&select=1518271

I tried using this and it works.

Friday, March 23, 2012

How to enable Remote Erros on Report Server 2005?

hi, all

When i tried to access a report via URL and I got an error page like:

Reporting Services Error

For more information about this error navigate to the report server on the local server machine, or enable remote errors
SQL Server Reporting Services

So, How to enable the remote errors and then I was able to see what is wrong.

Thanks.

You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table.

Alternatively, you can use the SetSystemProperties SOAP call:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_63le.asp

-- Robert

|||Hi, Sorry from the newbie question :)

I saw the answer:
"You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table."

How can I get to the ReportServer.ConfigurationInfo database table?

I am on the reportservice server and I run "reporting services configuration manager" and the "sql server managment". I didn't saw that option :(

Any help?
Thanks.
|||

Hi,

Go To SQL Server Management Studion , Select ReportServer Database and run below Statement

Select * From ConfigurationInfo

Where Name = 'EnableRemoteErrors'

Change the Value to True

Thanks

Nilesh

How to enable Remote Erros on Report Server 2005?

hi, all

When i tried to access a report via URL and I got an error page like:

Reporting Services Error


For more information about this error navigate to the report server on the local server machine, or enable remote errors


SQL Server Reporting Services

So, How to enable the remote errors and then I was able to see what is wrong.

Thanks.

You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table.

Alternatively, you can use the SetSystemProperties SOAP call:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_63le.asp

-- Robert

|||Hi, Sorry from the newbie question :)

I saw the answer:
"You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table."

How can I get to the ReportServer.ConfigurationInfo database table?

I am on the reportservice server and I run "reporting services configuration manager" and the "sql server managment". I didn't saw that option :(

Any help?
Thanks.

How to enable Remote Erros on Report Server 2005?

hi, all

When i tried to access a report via URL and I got an error page like:

Reporting Services Error


For more information about this error navigate to the report server on the local server machine, or enable remote errors


SQL Server Reporting Services

So, How to enable the remote errors and then I was able to see what is wrong.

Thanks.

You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table.

Alternatively, you can use the SetSystemProperties SOAP call:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_63le.asp

-- Robert

|||Hi, Sorry from the newbie question :)

I saw the answer:
"You could set the "EnableRemoteErrors" configuration value to True in the ReportServer.ConfigurationInfo database table."

How can I get to the ReportServer.ConfigurationInfo database table?

I am on the reportservice server and I run "reporting services configuration manager" and the "sql server managment". I didn't saw that option :(

Any help?
Thanks.

How to enable remote erros for report server?

hi, all
When i tried to access a report via URL and I got an error page like:
Reporting Services Error
----
For more information about this error navigate to the report server on
the local server machine, or enable remote errors
----
SQL Server Reporting Services
So, How to enable the remote errors and then I was able to see what is
wrong.
Thanks.I'm getting the same error. We can get around the problem for now by logging
onto the server to see exactly what the error is, but I have yet to find out
how to turn on remote errors.
Any one have any ideas how to do this?
"Nick" wrote:
> hi, all
> When i tried to access a report via URL and I got an error page like:
> Reporting Services Error
> ----
> For more information about this error navigate to the report server on
> the local server machine, or enable remote errors
> ----
> SQL Server Reporting Services
> So, How to enable the remote errors and then I was able to see what is
> wrong.
> Thanks.
>|||I have done this with RS 2000.
It is in the machine.config file for .NET Framework v1.1 in the
<windows>\Microsoft.NET\Framework\<Version>\ folder.
There is a XML Tag <System.Web>/<customErrors>
I think you set the value to "RemoteOnly"
It looks like there is a similar tag for .NET 2.0 but the config file looks
a little different. Hopefully, this can can point you in the right direction
-Sean
"Nick" wrote:
> hi, all
> When i tried to access a report via URL and I got an error page like:
> Reporting Services Error
> ----
> For more information about this error navigate to the report server on
> the local server machine, or enable remote errors
> ----
> SQL Server Reporting Services
> So, How to enable the remote errors and then I was able to see what is
> wrong.
> Thanks.
>|||Sean, I found on another posting that this setting is within the
ConfigurationInfo table in the ReportServer database. Setting the value to
True makes it work.
Steve
"Sean P." wrote:
> I have done this with RS 2000.
> It is in the machine.config file for .NET Framework v1.1 in the
> <windows>\Microsoft.NET\Framework\<Version>\ folder.
> There is a XML Tag <System.Web>/<customErrors>
> I think you set the value to "RemoteOnly"
> It looks like there is a similar tag for .NET 2.0 but the config file looks
> a little different. Hopefully, this can can point you in the right direction
> -Sean
>
> "Nick" wrote:
> > hi, all
> >
> > When i tried to access a report via URL and I got an error page like:
> >
> > Reporting Services Error
> > ----
> >
> > For more information about this error navigate to the report server on
> > the local server machine, or enable remote errors
> > ----
> > SQL Server Reporting Services
> > So, How to enable the remote errors and then I was able to see what is
> > wrong.
> >
> > Thanks.
> >
> >|||setting *what* value exactly? my ConfigurationInfo table has 9 rows in
it and none of these contain anything that looks like it may be the right
setting to change.
heres the contents of my ConfigurationInfo table.
EnableExecutionLogging True
EnableMyReports False
ExecutionLogDaysKept 60
MyReportsRole My Reports
SessionTimeout 600
SiteName SQL Server Reporting Services
SystemReportTimeout 1800
SystemSnapshotLimit -1
UseSessionCookies true
"SteveIrwin" wrote:
> Sean, I found on another posting that this setting is within the
> ConfigurationInfo table in the ReportServer database. Setting the value to
> True makes it work.
> Steve
> "Sean P." wrote:
> > I have done this with RS 2000.
> > It is in the machine.config file for .NET Framework v1.1 in the
> > <windows>\Microsoft.NET\Framework\<Version>\ folder.
> >
> > There is a XML Tag <System.Web>/<customErrors>
> > I think you set the value to "RemoteOnly"
> >
> > It looks like there is a similar tag for .NET 2.0 but the config file looks
> > a little different. Hopefully, this can can point you in the right direction
> >
> > -Sean
> >
> >
> > "Nick" wrote:
> >
> > > hi, all
> > >
> > > When i tried to access a report via URL and I got an error page like:
> > >
> > > Reporting Services Error
> > > ----
> > >
> > > For more information about this error navigate to the report server on
> > > the local server machine, or enable remote errors
> > > ----
> > > SQL Server Reporting Services
> > > So, How to enable the remote errors and then I was able to see what is
> > > wrong.
> > >
> > > Thanks.
> > >
> > >|||My ConfigurationInfo table has the following info
EnableExecutionLogging True
EnableIntegratedSecurity true
EnableMyReports False
ExecutionLogDaysKept 60
ExternalImagesTimeout 600
MyReportsRole My Reports
SessionTimeout 600
SiteName SQL Server Reporting Services
SnapshotCompression SQL
SystemReportTimeout 1800
SystemSnapshotLimit -1
UseSessionCookies true
Do we need to add a record for customErrors?

Monday, March 19, 2012

how to dynamically create report in web app?

Hello,
I am rather new to report service. What I want to achieve is prvide a web
page and let users to choose what fields they want to see, what table they
want to query and what formats they want to apply.
Is it something achievable? Would someone give me some tutorial or hints?
Many Thanks
--
hello, please helpAlthough possible it is not trivial. You need to know the RDL specification
(go to MSDN.microsoft.com and search on RDL specification, there are several
articles). Then there is the issue that this is a server based product, you
cannot change the RDL on the fly. You have to publish the RDL. With RS 2005
you can use the new controls and give the control the RDL and the dataset
(in local mode you do not even need the server). These controls come with VS
2005 (Not with SQL Server). So, check out the spec and see if this is really
something you want to tackle. Depending on the complexity you might be
better off to use XML and XSL instead.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
news:78300BE1-38D8-4491-997D-2C4C0EC98AFE@.microsoft.com...
> Hello,
> I am rather new to report service. What I want to achieve is prvide a web
> page and let users to choose what fields they want to see, what table they
> want to query and what formats they want to apply.
> Is it something achievable? Would someone give me some tutorial or hints?
> Many Thanks
> --
> hello, please help

Friday, February 24, 2012

How to do paging when there are over 80 000 rows in table?

I have one table in my db which contains some 80 000 rows of data. I want to list the rows in a web page so that one page has 200 rows. I also want to put the first,previous,next and last buttons into the web page so that the users can navigate between the pages/rows nicely.

How can i do this with SQL-Server? I dont want to read all the rows because it takes too long (20 seconds) and uses too much memory.

Do i have to do it like this?
SELECT TOP 200 * FROM TABLE WHERE ID>0 (First page)
SELECT TOP 200 * FROM TABLE WHERE ID>200 (Second page)
SELECT TOP 200 * FROM TABLE WHERE ID>400 (Third page)
... AND SO ON ...

ID = Primary key field (identity insert 1, +1)
(Of course the ID values are different than 0,200,400,... if there are deleted rows in a table.)Only 20 seconds for 80,000 rows of data in a web page - not bad. If you can use a query like select top 200 * from table where id > ?, then use a stored procedure with n as a parameter and use that to multiply by 200. As you progress through the web site, for next just add 1 and for previous subtract 1 from the value you submit to the stored procedure. You could use 1 asp page to handle this functionality. Normally, you are not this lucky and have to use remote scripting to handle large recordsets to return x rows to a web page.

Good luck.