.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Open a password protected package in C#

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
Hi - trying to write an app that opens packages in C# but have hit a stumbling block - how do you open a package that is password protected? The code I am using is: app.LoadPackage(packagepath, null) But I can't see how to pass the password in, so the code throws an exception. Cheers, James James Beresford @ www.bimonkey.com SSIS / MSBI Consultant in Sydney, Australia SSIS ETL Execution Control and Management Framework @ SSIS ETL Framework on Codeplex

View Complete Post

More Related Resource Links

SSIS Package Protection Level Errors - decrypt protected XML node "DTS:Password" with error 0x800900

Error 7 Error loading GetData.dtsx: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.   c:\Packages\GetData.dtsx 1 1  Error 8 Validation error. Data Flow Task: OLEDB Source [5310]: The AcquireConnection method call to the connection manager "SourceServer" failed with error code 0xC0202009. GetData.dtsx 0 0 Environment I need to execute - BIDSHave Solution, with files linked with VSS. When I click on package, aforesaid errors show up and package opens in designed.Protection Level : Encrypt Sesitive with User KeyThis means it'd run only on machine and by user where and who created respectively.So I changed it to Encrypt Sesitive with Passoword and provided Passoword. No luckSo I changed it to Do not save sensitive, as anyways in the connection manager, it has Expression saying @Variablename (with appropriate correct syntax), and variable is mapped to config file. I tired with Config file and also by hardcoding the value in the connection manager's connection string after removing the variable name, also tried by hardcoding value in variable value and disabling config file.Nothing works. I read 3 threads discussing this issue by othe

symmetric key protected by a password

An alternative could be using a symmetric key protected by a password, as long as your application generates the CREATE SYMMETRIC KEY and OPEN SYMMETRIC KEY statements directly instead of calling them inside a SP (otherwise the password will still be passed as a parameter, and will be in clear in the profiler).

Execute Package Task password issue

I have a parent and child package. Both are stored on the file system and both are password protected. My problem is that when I call the child package from the parent using execute package task, I get prompted for the child package's password. Now the PackagePassword property of the Execute Package Task is supposed to take care of that. But for some reason the password stored in the Execute Package Task is not getting passed to the child package.  I've re-entered the PackPassword property several times, but it did not help.  I even tried loading the password from a config file, but that did not make any difference.  Can anyone help?

BIDS wont let me edit script tasks, Package wont open without a "temp" folder in appdata???

I have a very stupid problem, because the way BIDS works is just hilariousy idiotic.    Short Story: 1) When i try to edit script tasks it will complain about "failed to create project at some random path in temp folder" and wont open anything. I cannot edit script tasks anymore. THe project is essentialy dead to me. REboot or restart wont help. I spent five hours on this project and i dont want to do all that work from scratch! 2) I cannot port my solution to antoher computer or place because it links to the files in appdata/local/temp folder of the pc for some reason. If i delete that folder or port the solution, it will complain about some file in temp folder called "3jews....tmp" and will say that solution is unopenable. Need help to resuce my project and be able to continue working on it!   Long Story: When you make a project, BIDS stores its files in a separate folder: a solution file, a project file, a package file etc. You might have thought, you can now carry your solution over by copying this folder. WRONG! The BIDS actually stores files of  the solution in /Users/name/AppData/Local/Temp folder! And It cannot open a solution/package/project without files from that folder, now what kind of idiotism is that?   It all started with BIDS not saving my script task changes, then telling me "cannot create project in folder

if ssis package writes to excel file that might be open by a user

I have written a package that writes to an excel file to a network folder. Eventually this package will run as a job. What is the best way to handle the situation where someone opens the file or inadvertantly leaving it open while the package is running and and stop the package.? No one needs to modify or write anything to this file after it is finished

Open Office Documents from Document Library without Password Prompt

We have a SharePoint site and Document library set up for anonymous access.   All non-Microsoft file types open correctly without a password.   When users click on Microsoft Office documents they are prompted for passwords.   Is there some way to configure the Office documents or Document Library so that users are not prompted for passwords when they open documents or is this a bug?

Failed to decrypt protected XML node "DTS:Password" with DontSaveSensitve Checked



I have been researching and researching this.  First, I have all my packages all have the protection level set to DontSaveSensitive.  Second, all my passwords are stored in a config file.  This config file location is stored in an env variable.  The packages are all calling the config files from package configurations.

If I do the development on our dev server I dont' have a problem. As soon as I go to our test box, I get the error or if another person accesses it and tries to run it they get the error.

I have no idea to fix this.  The only solution I have found anywhere is to change the protectionlevel.  Changing it to rely on server gives me more error messages.  I honestly don't remember having this issue before now.

please help!



Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B



I have developed several SSIS packages with the last Beta of VS2005 / SQL Server CTP. After the public release I tried to uninstall the CTP-Versions to install the msdn finals but this time I got lost and was not able to satisfy the requirements of the final setup of VS2005. So I decided to install the whole pc again and after some hours I had a clean machine (XP with latest SQL Server 2005 Standard and VS2005 Professional).


Now I have tried to open my SSIS-Project but getting the following error:


SSIS package not able to save encypted user sensitive password


i have an ftp fetch package in bus development studio 2008.  it runs from that interface.  i imported it into Integration Services, set the password along with the EncryptSensitiveWithPassword and if i manually enter password each time i can run successfully from sql integration services.  but i cannot schedule as a job because the password won't stick.

any help out there would be great.

Password protected PDF/Excel reports using SQL Reporting services


I am generating a reports using SQL Reporting services 2005. I need to protect the protect the reports(pdf and excel) with the password while the user is exporting the report to to excel or pdf.

Is there any way to protect the report.

Thanks in advance...


Cannot open SSIS 2005 package


HI, one of developers gets the folowing error when he tris to open a SSIS 2005 pacjage:

Could not load type 'Microsoft.SqlServer..Dts.Design.IDtsPipelineEnvironmentService' from assembly 'Microsoft.SqlServer.Dts.Design. Version=

Is there something I can do to resolve this issue?

Thank you,

Christian Cote

Failed to open package error from SSIS Install Wizard


I'm unable to install a package using the install wizard.  The packages are located in the same directory as the *.SSISDeploymentManifest.  I've been able to do this install on one Server machine, but it won't work on my other Server.  I'm unable to find any setup differences other than one is using SQL2005 32bit and the one that doesn't work is using SQL2005 64bit.

Below is the error I get...

TITLE: Package Installation Wizard

Could not save the package "C:\AlarmPro\Deployment\install 2.1 build3\PKG_LogicOneIntegration_STG.dtsx" to SQL Server "(local)".


Failed to open package file "C:\AlarmPro\Deployment\install 2.1 build3\PKG_LogicOneIntegration_STG.dtsx" due to error 0xC00CE558 "XML document must have a top level element.".  This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.


Linked Server to Password Protected Access Database


I want to create linked server in SQL 2005 with Ms Access 2003 Database. I have used following commands to create linked server.

EXEC sp_addlinkedserver
@server = N'TestLinkServer',
@provider = N'Microsoft.Jet.OLEDB.4.0',
@srvproduct = N'Access',
@datasrc = N'D:\Test.mdb',
@provstr = Null

EXEC master.dbo.sp_addlinkedsrvlogin

With above command linked server successfully create and can run SQL query against linked server. But if i set Database password to MS Access 2003 Database, then it gives following error message.

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "TestLinkServer" reported an error. Authentication failed.

Any ideas?


unhandled exception when trying to open one particular sub package


Hi.  Suddenly I am getting an unhandled exception when opening a DF in a subpackage from the CF.  The sub package currently runs in production with no problems.  I've made no changes to the subpackage.  I even copied the production dtsx to my working folder but get the same error.  The debug (after I choose debug in new instance of vs 2008) popup says Unhandled exception at 0x3f812b6a in devenv.exe: 0xC0000005: Access violation reading location 0x00000000.  The corresponding code looks like...


warning(suppress: 22008) /* prefast is confused */

onexitend = p + (onexitend - onexitbegin);

onexitbegin = p;

__onexitbegin = (_PVFV *)_encode_pointer(onexitbegin);




* Put the new entry into the table and update the end-of-table

* pointer.


*(onexitend++) = (_PVFV)_encode_pointer(func);


How to parse html code from Webpages and password protected Webpages

Hello i am making a programme to retrieve all the links to files (ex : www.mysite/file.zip) and embedded pictures frome a webpage

I tryed 2 ways

Method 1

I started with a webbrowser control and htmldocument class. that work perfectly but the webbrowser load everything like a real web browser whereas i only need to parse the html code.

for exemple when I use my program on this web site http://www.annabella.net/music.html I can heard the background music :-/....(even if my control is Visible=false)
the webbrowser.stop() method doesnt work (doesnt stop the music)
So i have a first question

How can i use the HtmlDocument class (to parse my code) without the annoyance of the  webbrowser control (that load everything when i only need a html document) or at least sidestep the music issue :-/

Method 2
after many days diggin the web i found other way to grab html code from a page and parse it easily
I use the microsoft html library from COM and the .createDo

How To Open Fancy Tooltip from GridView

This article will show How To Open show Fancy Tooltip in GridView.

How to Encrypt and Decrypt a Password using SQLSERVER 2005?(Video)

Encypt and Decrypt a Password using SQLSERVER 2005(Video)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend