Friday, November 12, 2010

Delete a variable in SSIS Package

To delete a variable from a package

1.In Business Intelligence Development Studio, open the Integration Services project that contains the package you want.

2.In Solution Explorer, right-click the package to open it.

3.On the SSIS menu, click Variables. You can optionally display the Variables window by mapping the View.Variables command to a key combination of your choosing on the Keyboard page of the Options dialog box.

4.In the Variables window, click Show User Variables.

5.Select the variable to delete, and then click Delete Variable.

6.If the Confirm Deletion of Variables dialog box opens, click Yes to confirm.

7.To save the updated package, click Save Selected Items on the File menu.

Wednesday, November 10, 2010

How to raise Error event in SSIS?

Syntax

ComponentMetaData.FireInformation(int InformationCode,
string SubComponent,
string Description,
string HelpFile,
int HelpContext,
out bool pbFireAgain
)

FireCustomEvent
Raises a user-defined custom event in the package.

FireError
Informs the package of an error condition.

FireInformation
Provides information to the user.

FireProgress
Informs the package of the progress of the component.

FireWarning
Informs the package that the component is in a state that warrants user notification, but is not an error condition.

e.g.

bool pbFireAgain = false;

ComponentMetaData.FireInformation(0, string.Empty, "Information", string.Empty, 0, ref pbFireAgain)

Check for file existence in SSIS

How do you check to see if a file does not exist in SQL Server Integration Services (SSIS)?

Use script component and add the following script.

If System.IO.File.Exists("\\Server\Share\Folder\File.Ext") Then
Dts.TaskResult = Dts.Results.Success
Else
Dts.TaskResult = Dts.Results.Failure
End If

The File System Task in SSIS can be used to move, copy, delete files and folders but does not support file existence checks.

Friday, October 08, 2010

How to Add onLoad JavaScript event in SharePoint?

Scenario
If you a have some javascript code that needs to be executed on the onLoad event of a page in SharePoint.

Solution
SharePoint provides a JavaScript array "_spBodyOnLoadFunctionNames", any function to be executed onLoad needs to be added to this array e.g.

Monday, September 20, 2010

Important: ASP.NET Security Vulnerability

ASP.Net uses encryption to hide sensitive data and protect it from tampering by the client. However, a vulnerability in the ASP.Net encryption implementation can allow an attacker to decrypt and tamper with this data.

But what can the attacker do with this capability? Part of the answer depends on the ASP.Net application being attacked. For example, if the ASP.Net application stores sensitive information, such as passwords or database connection strings, in the ViewState object this data could be compromised. The ViewState object is encrypted and sent to the client in a hidden form variable, so it is a possible target of this attack.

If the ASP.Net application is using ASP.Net 3.5 SP1 or above, the attacker could use this encryption vulnerability to request the contents of an arbitrary file within the ASP.Net application. The public disclosure demonstrated using this technique to retrieve the contents of web.config. Any file in the ASP.Net application which the worker process has access to will be returned to the attacker.

Workaround

The workaround for this vulnerability is to use the customErrors feature of ASP.NET to configure applications to return the same error page regardless of the error encountered on the server.

By following the steps in the advisory to map all error messages to a single error page, you make it difficult for the attacker to distinguish between the different types of errors, effectively limiting access to the oracle.