.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

Having trouble using Script Componet as a Transform for XML block of data

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :
Hi all
I'm trying to read in a block of XML data from a data base table in VB.  I'd like to read in the chunk of XML in the script componet and use XPath to breakup and send out seperate columns.  I'm stuck on how to read in the block from the input buffer.  I though I could do this:

Public Overrides Sub input0_ProcessInputRow (ByVal Row As input0Buffer)

     Dim docNav As XPathDocument = New XPathDocument(Row.XMLChunk))  //where this would bring in the XML and create a XPath document object

where XML Chunk is the Input Column name.  I know this should be easy to do I just have never had to work with XPath and crazy XML formatted messages.

View Complete Post

More Related Resource Links

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Microsoft Application Block for Data Access in .NET


Hi all,

I was rummaging the internet learning aspx and came across the concept of: Microsoft Application Block for Data Access in .NET

It seems great of course. The articles are all early 2003-5 such as


So the question is - is this tech still relevant and should I be using it?



Data Points: The Enterprise Library Data Access Application Block, Part 3


E nterprise applications can have a wide variety of data update requirements. Sometimes you need to save multiple rows of changes at once within a single transaction. Other times, the user must be allowed to enter multiple rows of data, send them to the database in a batch; and if a row or two fails, only the rows that succeeded should be committed and remain committed.

John Papa

MSDN Magazine October 2005

Data Points: The Enterprise Library Data Access Application Block, Part 2


Last month I explored the foundation of the Enterprise Library Data Access Application Block (DAAB) including how it all fits into an architecture (see Data Points: The Enterprise Library Data Access Application Block, Part 1).

John Papa

MSDN Magazine August 2005

Data Points: The Enterprise Library Data Access Application Block, Part 1


A solid data access later (DAL) can benefit an application by hiding redundant tasks, helping handle exceptions more gracefully, helping clean up resources more efficiently, and providing a layer of abstraction from the database.

John Papa

MSDN Magazine July 2005

Scripting SQL: VBScript Interfaces in SQL Server 2000 Let You Transform Data and Provide Reports to


Application service providers often must send information to clients automatically rather than on-demand. For example, a manufacturer may want to know each day how many of their products were sold by a retail chain. While SQL Server is ideal for maintaining this type of database, you have to write scripts to get the data out in a client-friendly format. Here you will see how you can use Data Transformation Services (DTS), a powerful tool in SQL Server, to automate the retrieval and formatting of data from SQL Server 2000 and make the process of pushing data to your users a lot easier.

Alok Mehta and Daniel Williams

MSDN Magazine August 2002

How to detect that a Data Flow Task has failed (from inside a custom componet)

Hi, in the PostExecute Method of a custom component i would like to check if the Data Flow Task has been failed. Is that possible? Also it would be great to be able to check if this custom component already got all data or has been marked as "green".  Thanks, Dennis

C# newbie stuck - trying to access column data in a SharePoint list in an SSIS script task

Hello, I'm sure this is the simplest question but I can't figure it out, even with Google's help. I am trying to stumble through some C# code in an SSIS script task and I am frustrated that I can't figure out how to do the easiest things.  I eventually want to find data in a column,and then use another list as a lookup to replace that value with another where the existing value matches a value in the lookup list.  So, the data in my (multiple choice) column might be "apples; bananas" and in another list I have a row that contains two columns, the first holding the value "Apples" and the second containing "Red Delicious" and my original column should read: "Red Delicious; bananas." But, alas, I can't even figure out how to see the data that is in a column. Here is my code: /*<br/> Microsoft SQL Server Integration Services Script Task<br/> Write scripts using Microsoft Visual C# 2008.<br/> The ScriptMain is the entry point class of the script.<br/> */<br/> <br/> using System;<br/> using System.Data;<br/> using Microsoft.SharePoint;<br/> using Microsoft.SqlServer.Dts.Runtime;<br/> using System.Windows.Forms;<br/> using Microsoft.SharePoint.Utilities;<br/> <br/> namespace ST_08becda4c05c49cd9f30ea76110076cd.csproj<br/> {<br/> [

Error in Script component in the Data Flow Task

Hi, I need a small help. This is what i require. I need to generate a auto increment number using script component and assign it to target column. use db1 go create table src (name varchar(10) ) insert into src select 'A' union all select 'B' union all select 'C'   create table trg (id int, name varchar(10) ) while loading the trg table, i need to generate a auto increment number and then load it to target. Finally, my trg table data should look as follows id name 1  A 2  B 3  C This is what i have done inside the package. step1 : declared a global variable "tmp" of int32 step2 : created a connection manager pointing to "db1" database step3 : drag n drop data flow task step : inside the data flow task , i have the following        OLEDB Source  (select name from src)           |        Script Component (i have added a new Output column "v_id" of int datatype in INPUTS AND OUTPUTS page)           |        OLEDB Destination In the Script page in Script component , in ReadWriteVariables | User::tmp, I have chose Visual Basic 2008 and clicked the EDit script and inside the Editor this and inisde the below routine i have added only two

I need to create a script in SSIS which creates a data source that connects to an Access database.

I need to create a script in SSIS which creates a data source that connects to an Access database. The Access database file name needs to be set as a variable as it will change from month to month. I have no idea what I am doing can anybody give me some tips? Mr Shaw

Data in a web method block

[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]   public static string[] GetCompletionList(string prefixText, int count, string contextKey) {       // Create array of movies       string[] movies = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"};          // Return matching movies       return (from m in movies where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();   }  Disclaimer: I'm totally new to all this.Problem: The above code works great for me in getting the Autocomplete AJAX control to work. However, what I need is to define the string[] variable outside of the above block. What I'm looking for is the way to define such a variable as a global, or whatever the technical term in asp.net is for a variable that is persistent and recognized wherever it is used in the code-behind.Is this possible, without massive amounts of technical wizardry?

Block content/documentation search for sensitive data.

I want to hide sensitive document from search result for normal users. Where same document will be available in search result for Marketting group. I think crawl rule is not going work here. Does anybody has any idea?

Trouble using GetListItemFields to pull data from List

First, a summary of what I am trying to do: - I want to use a workflow to create a new site automatically when a user adds a row to the List called "Registry". They choose a title and a Template, I want to take this information and use it in the workflow to create a new site. -So far I am able to create a new site when a row is added, but I cannot incorporate the info that the user entered. Below is the code that I am using inside OnWorkflowActivated to access the "Title" and "Template" fields that the user is entering in the "Registry" List. Any help would be greatly appreciated. Also included is a link to the GetListItemFeilds info page.   http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getlistitemfields.aspx ***I only have localhost there for privacy reasons***   private void onWorkflowActivated(object sender, ExternalDataEventArgs e) { SPSite site = new SPSite("http://localhost"); SPWeb web = site.OpenWeb(); string itemURL = "/Lists/Registry/AllItems.aspx"; try { string[] itemFields= { "LinkTitle", "Template" }; SPListItem item = web.GetListItemFields(itemURL, itemFields); foreach (string fieldName in itemFields) Console.WriteLine("{0} = {1}", fieldName, item[fieldName]); } catch (NullReferenceException nre) {

Writing XML data from URL to Object in SSIS Script Task

I have this URL where there is XML data. I have to extract that data from URL and dump it into DW table. I am using SSIS Script Task for that.

This is how the data looks like:
<cname>United Arab Emirates Dirhams</cname>
<cname>Afghanistan Afghanis</cname>
<cname>Albania Leke</cname>

This is the code i'm using to load it into some Object type or something. But i dont know how to do that.

public void Main()
   String URLString = "http://www.xe.com/dfs/datafeed2.cgi?beeline";
   XmlDocument doc = new XmlDocument();
   XmlTextReader reader = new XmlTextReader(URLString);

   XmlNodeList currencynodes = doc.SelectNodes("currency");
   foreach(XmlNode currency in currencynodes)
    XmlNode csymbol = currency.SelectSingleNode("csymbol&quo

Handling NULL inside Script Componet


Hi Guys,

I would like to know what wrong in my code to handle my NULL values.

Row.GroupSize and oGroupSize has a Double Datatypes. I want the value of GroupSize remains as NULL. But apparently, this code gives me numbers and not NULL.

If (Row.GroupSize_IsNull) Then
   .oGroupSize = Convert.ToDouble(DBNull.Value)
   .oGroupSize = Row.GroupSize
End If



How can I avoid entering Output columns manually (with their data types) in the Script Transformatio

I created a wrapper to a WCF web service that is returning many datasets with hundreds of columns.  The destination database schema matches the source schema exactly.  When i make the connection on a ADO.NET destination object to my database it auto-generates my list of columns.  I understand that the script component could output anything so it can't autogenerate at this point, but is there any way to copy and paste the Column definitions from somwhere else and paste them in?  I'd like to avoid spending hours entering all these manually.

block dba access to user data


Is there a way in sql 2008 to block a dba's access to user data? I think the capability exists. however I cant seem to find any documentation on it.



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