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

Top 5 Contributors of the Month
Post New Web Links

Strange Rounding Behavior

Posted By:      Posted Date: October 16, 2010    Points: 0   Category :Sql Server

Ugh.  I have been fighting rounding problems in my SSIS package since yesterday morning.  I have traced the rounding problem back to what appears to be an undesired rounding of a decimal to the tenths place when retrieving data via OLE DB Source and I can't figure out how to fix that.

I have a Source database which is Sybase.  There is a table (let's call it "foo").  In the "foo" table there is a column (let's call it "amount").  For a given row in the "foo" table, the "amount" column equals exactly 1.875.

When my OLE DB source retrieves the data it retrieves the value of "amount" for that row as 1.9 instead of 1.875.

If I use an MS Access app to connect to that same Sybase database via ODBC and retrieve that exact same row from the "foo" table the value of "amount" is correctly retreived as 1.875.

I have tried playing with the advanced settings of my OLE DB source and setting the source column type to double precision float instead of just float (DT_R8 vs DT_R4) to no success.  When I preview the data (or run the SSIS package) the value is retreived as 1.9 instead of 1.875.

Any help on why this is happening would be appreciated.  It is causing me a real headache (and inaccurate data results as well)

- Charles

View Complete Post

More Related Resource Links

Strange Authentication Behavior...

I have an installation of SSRS 2008 that is exhibiting some very odd behavior with regards to authentication and permissions. I have SSRS installed on a box called SERVER1 and I'm a local admin on the box and an Administrator on the SSRS instance. This box has an IP address of When I go to the Report Manager URL, I see everything I should (Home, Site Settings, etc.) I'm able to go in and set up security and create folders and everything. What's odd is that if I use the IP address instead of the server name in the Report Manager URL, I get to the home page but there is nothing displayed, only Home, My Subscriptions, and Help. There are no report folders visible and the options available to admins aren't visible. One thing that may shed some light on things: if I do a ping -a on the IP address, it resolves to the host name. If I ping the host name, I get back a reply from ::1: I have no idea why permissions would differ between a host name and an IP address if they're the same server?? Any insight would be appreciated!A. M. Robinson

WPF Window as Modal Dialog, strange behavior

Hopefully someone has a clue.... My application displays WPF Window as a modal dialog box. The dialog box has a few child user controls, one of which has combo box. When the user clicks this combo box to select... the whole dialog disappears except of the innards of the combo box. So the user only sees the list box of the combo box. Here are the details I got from the  client: The window itself is launched from non WPF application (Lotus Notes). This happens only on a few machines. The OS is Windows XP SP3. There is no issue with the parent handle, windows owner, etc... I've seen this behavior during the development phase, only when running under a debugger.    Thanks, Michael        

Validation.Error giving strange behavior

I'm seeing some weird behavior with the Validation.Error attached event. I have a textbox bound to an object that implements the IDataErrorInfo interface. The textbox subscribes to the Validation.Error event. What is weird is that when you put the text box into an invalid state, the Validation.Error event gets triggered twice. Under .NET 3.5, the first time ValidationErrorEventArgs.Action == Removed. The second time ValidationErrorEventArgs.Action == Added. Under .NET 4, it's reversed. The first time ValidationErrorEventArgs.Action == Added. The second time ValidationErrorEventArgs.Action == Removed. Why would it be called twice and why would it work differently under .NET 3.5 and .NET 4? I'm trying to implement a validation summary control similar to the one from ASP.NET. There is a solution here: http://codeblitz.wordpress.com/2009/05/12/wpf-validation-summary-control/ but it doesn't work under .NET 4 because in order for it work work, when you put a control into an invalid state, the last call to the Validation.Error event has to be with ValidationErrorEventArgs.Action == Added. Here is my code:   <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplicatio

ListBox.SelectedItem stuck at whatever is first selected and other strange ListBox behavior

Hi, I've built a List<Participant> (Participant being my custom type) and assigned this to ListBox.ItemsSource. (I'm aware this is more the Windows Forms way than the WPF way of databinding, but I'd still like to understand what's going on here - even though suggestions on how to perform my task in a more WPF-y way are also welcome.) I've set ListBox.SelectionMode to Single, and attached an event handler to the SelectionChanged event. In this handler, I dump the SelectedIndex and SelectedItem to debug output. Contrary to my expectation, 1) SelectedIndex is always -1. This isn't really causing me any trouble, but it's certainly not what I'd expect. 2) SelectedItem refers to the correct object the first time (in the windows lifetime) I select an item, but then keeps referring to this first-selected item regardless of whether I deselect (by clicking the item again while holding down the CTRL key) or select some other item. 3) If I keep clicking around and scrolling a bit (the list has ~320 items) within the list, now and then the list suddenly displays a bunch of items - sometimes many in a row, sometimes non-contiguous items, but it seems always "nearby" items! - as if they were selected. The list keeps firing the SelectionChanged event, but SelectedIndex is forever -1 and SelectedItem (and SelectedValue) always refers to whatever I had selected the fir

strange mdx behavior in strtomember


i have a following piece of mdx

scope (dimension.member)



("Measures." + "[" + [Measures].CurrentMember.Name + "- X" + "]");

Strange ScrollViewer Behavior



When i use the following code, my scrollviewer appears for both vertical and horizontal. however the up and down arrows, and the left right arrows appear back to back. these buttons work fine. they just look terrible. after all the down button should appear at the bottom of my grid.

Can anyone help me out.



Gary Rusher

<local:BooleanToColorConverter x:Key="BooleanToColorConverter"/>

    <DataTemplate x:Key="BasicComponent">
      <TextBlock Text="{Binding Path=Description}"
            Foreground="{Binding Path=Rendered,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,Converter={StaticResource BooleanToColorConverter}}">
    <HierarchicalDataTemplate x:Key="ComplexComponent"
                 ItemsSource="{Binding Components}">

strange mdx behavior in strtomember


i have a following piece of mdx

scope (dimension.member)



("Measures." + "[" + [Measures].CurrentMember.Name + "- X" + "]");

Strange behavior for a workflow



I have a lot of strage behavior regarding my workflow host and it's workflows. I'll jump right into it. I use both the persistance and tracking service that comes out of the box. The WF host is hosted as a windows service and I have a WCF interface to "talk" to the host. WCF exposes methods like: "Start this workflow", "Change the status of this workflow" and "Terminate this workflow".

The strange behavior I talk about is this. When I call "Terminate workflow" I look in the tracking table WorkflowInstanceEvent I see this for the particular workflow:

WorkflowInstanceEventId WorkflowInstanceInternalId TrackingWorkflowEventId EventDateTime EventOrder EventArgTypeId EventArg DbEventDateTime
124715 15769 0 2010-09-27 17:20:42.210 1 NULL NULL 2010-09-27 17:20:45.930
124717 15769 12 2010-09-27 17:20:42.213 2 NULL NULL 2010-09-27 17:20:45.937
124719 15769 2 2010-09-27 17:20:42.237 5 NULL NULL 2010-09-27 17:20:45.957
124720 15769 6 2010-09-27 17:20:42.240 6 NULL NULL 2010-09-27 17:20:45.960
124721 15769 5 2010-09-27 17:20:42.247 7 NULL NULL 2010-09-27 17:20:45

strange behavior on form submit



i have a strange issue happening while submiting a form:

i have this in my form:

<input type="radio" name="type" onclick="document.getElementById('Type').value='Publiser';" />Publisher <br />
<input type="radio" name="type" onclick="document.getElementById('Type').value='Advertiser';" />Advertiser
<%: Html.TextBoxFor(m => m.Type)%>

the javascript is working perfectly and changes the value of the textbox.

the problem happens when i submit the form - what is extracteed by the model from the textbox is the string "on", and after the submit, it also changes the value of the textbox to "on".

when i load the field with a value from the model, it goes ok, and does not change

any ideas?

Strange web.sitemap asp:menu behavior


I have a menu that is populated from a web.sitemap.  It works most of the time but on some every once in a while the links will have "/(x(1))/" inserted into them.   The links still work but people are prompted to login for each page they go to.

If I compare my local copy of the web.sitemap with the live one they are identical.  Replacing the live sitemap with my local copy fixes the problem.  I can even copy the live one down to my local machine and then back up and it will fix the problem.  So something is being reset, I'm just not sure what it is.  Any thoughts on how to fix this?

This is the only search result that seems relevant but I'm still not sure how to go about fixing it.


Strange behavior with $().load in Javascript in MVC view


 OK i have a javascript which calls the two Java commands:




These are called after a submit button is pressed (there are additional script commands before these).  Both DuplicateFilesList and UploadedFilesList are the ID of a <div> on the page.  the problem I am having is that the #uploadedFilesList <div> is updated appropriately every single time.  Works like a charm.  the #DuplicateFilesL

Strange behavior of UserControl_SizeChanged event

Hello All,

I'm working with Silverlight 4 and followed directions in this post http://forums.silverlight.net/forums/t/69118.aspx to overlay an inner grid on top of a canvas, both of them in a outgrid.

Next I programmatically added columns to the inner grid and stackpanels to fit the column sizes. Next I added buttons to the various stackpanels. 

My next task was to add lines between the buttons in a parent child relationship(basically a tree). I have enclosed the drawing procedure in a private function and call that function from UserControl_SizeChanged event.

These are my experiences and I'm perplexed at the reason for the following behaviour.

1. UserControl_SizeChanged event is fired twice when application loads

2. When the application first loads  the tree formation is perfect starting from the root node on the left of the screen. Issue comes up when I resize the browser windows. The arrow lines between buttons does not disappear and more lines appear in the tree. Strangely this happens only between the root node and nodes in the first level. As play around resizing the browser arrow lines multiply many fold only between the root node and nodes at the first level(root node's childred).

Strange ModalPopUp behavior



I use .Net Framework4.0 and Ajax control Toolkit.Binary.NET4.0

When I use a ModalPopupExtender it works fine but sometimes it has a strange behavoir.

It could popup behind the default.aspx page so the default.aspx page stays on front and pnlModalPopUp on the back.

How can I prevent the ModalPopUp from this undesirable behavior?



<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<AjaxToolkit:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlModalPopUp" BackgroundCssClass="ModalBackground" CancelControlID="CloseBtn" >
<asp:Button ID="btnShowPopup" runat="server" style="display:none" />
<asp:LinkButton ID="CloseBtn" runat="server" OnCommand="Button_Click" CommandName="Close">
<asp:Panel ID="pnlModalPopUp" runat="server" CssClass="ModalPopup" Style="display:none;">
<img alt="" src="" ID="Ima

Pub/Subscriber Record Mis-match WITH strange behavior


We have hundreds of Publication we replicate via transact replication.


One such set of publications (all of them for the DB I will discuss) were found to have more records on the publisher than on the subscriber.


It was not a matter of a DML operation removing the records on the subscribers.


Here is a hit list of what happened and what we did …



Conrtol.Capture property. Strange behavior.


I set Capture = true of the Form when user presses Alt.

Controls do not "see" mouse after that, only Form receives MouseMove events. That's ok.

When user releses Alt-key Form sets Capture to false but controls still feel no muse presense (no MouseMove, MouseEnter).

Click on the Form or control is required to normalize the behavior. 

What's wrong?

[SSIS 2008] : strange behavior when exec from job




Here's my configuration :


Windows Server 2008 R2

SQL Server 2008 R2

All 64bits



I designed SSIS packages running well in BIDS.

In these packages I have ScriptComponent whith stringbuilder preparing update queries I execute later.

In these strings I manipulate, there's dates.

As my database as well as my source are in French I use : 

  Dim myCIntl As New CultureInfo("fr-FR", False)
  Threading.Thread.CurrentThread.CurrentCulture = myCIntl

Else I get issues on date format.


Everything is ok when run under BIDS.


The SSIS packages are SQL Server stored and called from a SQL Server job.

Then I have error pointing to the ScriptComponent task where I do all my stringbuilder ...

I don't know why (of course as I'm asking for help ;-) )


Thanks a lot if you have any guess of why there's this different behavior.




Strange behavior when validation type of rule is applied in Infopath


I've designed InfoPath 2010 form which is browser enabled and 2007 compatible.

In one numeric text box, a Validation rule is written such that if user enters anything outside 0-100 range, it'll display an error message.


1. User opens the form and starts filling the controls.

2. User enters a number in this numeric text box and comes out of the textbox.

3. When focus is lost, validation rule gets triggered.

4. Infopath screen flickers (kind of), reposition itself to the original state.

Question 1: Why does it happen like this? This behavior does not happen in case of "Formatting" type of rule, but happens in "Validation" type of rule.

Question 2: Is validation rule a server-side? What about Formatting rule?

Question 3: This is not related to validation rule. When a textbox value is made right-aligned, we do not see the cursor inside textbox while entering the value. Is it the normal behavior? Is there any way to get rid of this?


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