Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

Urgent!...SQL Server cannot handle "CDEC" in web application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
_YES - 26 Feb 2007 22:55 GMT
Please, can sombody help me with this problem.

I have created a web application, in visual studio 2005 professional. This
application needs to convert some string values, from an externally stored
SQL database table, to decimals. When the application has been compiled and
is running locally in the computer everything works fine, all calculations in
the application end up correctly.

The problem comes when the application  is running at the web server (an
extern SQL Server), then all calculations goes wrong, badly wrong!!!
 
0,46 * 0,56  ---> 0
123,456   --->   123456

and so on...  Why??

------------------------
Example, calculation from code:

tSum = Round(totSum + (NullSafeDecimal(reader.Item("column1")) *
NullSafeDecimal(reader.Item("column2"))), 2)

'****************************************************
   ' NullSafeDecimal
'****************************************************
   Public Shared Function NullSafeDecimal(ByVal arg As Object, _
     Optional ByVal returnIfEmpty As Integer = 0) As Decimal

       Dim returnValue As Decimal

       If (arg Is DBNull.Value) OrElse (arg Is Nothing) _
                        OrElse (arg Is String.Empty) Then
           returnValue = False
       Else
           Try
               returnValue = CDec(arg)
           Catch
               returnValue = False
           End Try
       End If

       Return returnValue

   End Function
Patrick Steele - 27 Feb 2007 01:15 GMT
> I have created a web application, in visual studio 2005 professional. This
> application needs to convert some string values, from an externally stored
[quoted text clipped - 9 lines]
>
> and so on...  Why??

Are the regional settings for both machines exactly the same?

Signature

Patrick Steele
http://weblogs.asp.net/psteele


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.