.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

Handling NULL inside Script Componet

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :Sql Server

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



View Complete Post

More Related Resource Links

CLR Inside Out: Handling Corrupted State Exceptions


There's a danger in using one-size-fits-all exception handling, and you need to know how to avoid it by being as specific as possible about how you handle errors.

Andrew Pardoe

MSDN Magazine February 2009

Custom Dataflow componet in Null checking

Hi I want to create the custom Null checking and data length checking component. like Dataprofiling Please suggest it. Regards Ram  

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

Click.CommandParameter null when binding on Button inside DataGrid DataGridTemplateColumn

I am having trouble getting a Click.CommandParameter to pass through with a bound Click.Command. I have a DataGrid with a DataGridTemplateColumn that contains a couple of Buttons. Using a suggestion found on the forum (http://social.msdn.microsoft.com/Forums/en/wpf/thread/541024a9-3d7e-4c6a-b88e-9a7eb7ee83a9), I was able to get the Click.Command to bind to the right command, but when arriving in the corresponding method in my ViewModel, the parameter is null.  Here is my xaml for my DataGridTemplateColumn <data:DataGridTemplateColumn Header="Case">  <data:DataGridTemplateColumn.CellTemplate>   <DataTemplate >    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">     <Button Content="Open" Margin="6,0" command:Click.Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type data:DataGrid}}, Path=DataContext.OpenCaseCommand}" CommandParameter="{Binding}"  />     <Path Data="M1,1 L1,2" Stroke="#FFCCCCCC"/>     <Button Content="Rename" />    </StackPanel>   </DataTemplate>  </data:DataGridTemplateColumn.CellTemplate> </data:DataGridTemplateColumn> I used Snoop to see what was going on. Everything

Tab Panel inside a User control - null referance to text box with set properties

Hi guys, Im having problems with the following: I have a user control which has a tabbed panel inside, I then have a public property which populates a textbox inside the tabbed panel, HOWEVER when I access the property on my ASPX page, it give me a null referance to textbox, I have tried using findControl but still finds nothing, Please help!! ASPX PAGE  <Registration:UserDetails UserID="23" ID="RegistrationUserDetails" runat="server" /> USER CONTROL<cc1:TabContainer ID="TabContainerRegistration" runat="server" ActiveTabIndex="1" > <cc1:TabPanel runat="server" ID="TabPanelAccessDetails" HeaderText="Access details"> <ContentTemplate> <table> <tr> <td>User ID</td> </tr> <tr> <td><asp:TextBox ID="UserIDTextBox" ReadOnly="true" runat="server" SkinID="InputBoxes"></asp:TextBox></td> </tr> </table> </ContentTemplate> </cc1:TabPanel> </cc1:TabContainer> CODE BEHINDprivate int _UserID; public int UserID { set { TextBox tb = (TextBox)TabContainerRegistration.

Sorting inside Script Component


Hi Guys,

A weird question, but i need to do a sorting inside of the Script Component. I have a RowNumber Column, that i need to sort by ascending.

Is their away to do this?



NULL value of Gridview inside Datalist


I am using a gridview, which is inside datalist, but whenever I try to serach gridview in datalist it reyurns NULL. I using the following code, bolded line is not able to assign gridview:

amespace DataListXML
    public partial class _Default : System.Web.UI.Page
        DataSet _dataSet;
        protected void Page_Load(object sender, EventArgs e)

Script task inside a script task

How to call a script task from another script task?

SSIS Script Componet to change Flat File LF to CR LF



I have a corrupt Flat File and I need to write a SSIS Script Component to Replace LF to CR LF in my flat file.

Any idea how to do it?



Object Value lost in script component inside for loop container

Hi All,

I need your expert advice here,

I have 5000 records to transform into csv file and due to the application limitation, the upload module to upload those 5000 records only can be done by batch of 100-200 record at one time.

Because of this, i try to use for loop to split the records into a few files e.g EE_1.csv, EE_2.csv.

The records was retrieved and saved into an object variable (ResultSet) before entering the For Loop flow

The issue i encounter, when it was on the 1st loop everything was fine, it is manage to generate X Records i specified but when it go for 2nd loop, the ResultSet is returning 0 Records..when the actual total records is 5000

Anyone can help this newbie what are the mistakes i made ?

The logic is something like

Public Overrides Sub CreateNewOutputRows()
oledbAdapter = New OleDb.OleDbDataAdapter
dataTable = New DataTable

oledbAdapter.Fill(dataTable, Me.Variables.resultset)
StartPoint = Me.Variables.FilesNumber 'To know which row to start
StartPoint = (StartPoint - 1) * Me.Variables.MaxRecord
EndPoint = (StartPoint + Me.Variables.MaxRecord) - 1

If dataTable.Rows.Count - 1 < EndPoint Then
EndPoint = dataTable.R

Script Component: Null value Exception



When I ran the 2008 SSIS package I am getting error at Script component (Script Component: RunTime Error  The column has NULL Value).

at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.CheckStatusAndNull(Int32 columnIndex)

at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.GetInt32(Int32 columnIndex)

at ScriptComponent_14ee8da369a64bce8aff81b1e175b6b0.vbproj.Input0Buffer.get_RedemptionItem()

at ScriptComponent_14ee8da369a64bce8aff81b1e175b6b0.vbproj.ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)

at ScriptComponent_14ee8da369a64bce8aff81b1e175b6b0.vbproj.UserComponent.Input0_ProcessInput(Input0Buffer Buffer)

at ScriptComponent_14ee8da369a64bce8aff81b1e175b6b0.vbproj.UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

Please Suggest the best way to handle the NULL values in Script component (like is there any setting which can allow NULL values in Script component OUTput Buffer).

Thanks in advance



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

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.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#
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