Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:740234
More Search Options
RSS Available
Matching Posts
Re: double addition or string concatenation? what point am I missing?
Pay attention to this line: WITH STR PREFIX WITHOUT PARENTHESIS: 360084 I noticed that d1 turns to be 3600, which indicated me there is something going wrong with double.Parse Well I checked the computers I was trying to execute my code. They were all using non-us number format which was my problem. Then Instead of direct cast: double.Parse(str) I used: double.Parse(str, new CultureInfo("en-US")) then the problem disappeared!!! Thanks for all ; )
Posted to
C#
(Forum)
by
Aleyna
on 4/6/2009
Re: double addition or string concatenation? what point am I missing?
Purely console ; ) okay I somehow debugged it using the code segment: double d1 = truck2CustomerMapping.Select(p => p.Customer.Costs[p.Truck.TruckIndex]).Sum(); double d2 = truck2CustomerMapping.Select(p => p.Truck).Distinct().Sum(t => t.SetupCost); upperBound = d1 + d2; Console.WriteLine("Type of d1: " + d1.GetTypeCode().ToString()); Console.WriteLine("Type of d2: " + d1.GetTypeCode().ToString()); Console.Write("WITHOUT STR PREFIX:"); Console.WriteLine(d1
Posted to
C#
(Forum)
by
Aleyna
on 4/6/2009
Re: double addition or string concatenation? what point am I missing?
As VS is installed on my development PC and I'm running compiled executables on other computers, I guess I cannot do this directly. Do you know any other way to debug?
Posted to
C#
(Forum)
by
Aleyna
on 4/6/2009
Re: double addition or string concatenation? what point am I missing?
no problem ;) Well I now double checked the versions. My machine runs on .NET 3.5 SP1. I cloned all the things, tried .NET 3.5 as well but no way. I also tried the way you suggested and used two separate double but it concatenated the numbers again and printed 3684 :s what's going on :D???
Posted to
C#
(Forum)
by
Aleyna
on 4/6/2009
Re: double addition or string concatenation? what point am I missing?
[quote user="Naom"] Are you sure it's C# code and not C++ code? Looks like pointer arithmetic to me... [/quote] Of course C# not C++ I'm simply using a LINQ query to calculate total cost as follows: Below two instructions both return a double type thus isn't it a simple double addition :? double uppoerBound = 0; upperBound = truck2CustomerMapping.Select(p => p.Customer.Costs[p.Truck.TruckIndex]).Sum() + truck2CustomerMapping.Select(p => p.Truck).Distinct().Sum(t =>
Posted to
C#
(Forum)
by
Aleyna
on 4/6/2009
double addition or string concatenation? what point am I missing?
Hello I have the following code: double upperBound = 0; upperBound = truck2CustomerMapping.Select(p => p.Customer.Costs[p.Truck.TruckIndex]).Sum(); upperBound += truck2CustomerMapping.Select(p => p.Truck).Distinct().Sum(t => t.SetupCost); Console.WriteLine("Total Cost: {0}", upperBound); It compiles perfectly however when it comes to run, it outputs say 'Total Cost: 3684' that originally should be (36+84 = 120) Total Cost: 120 Well, it just concatenates the double values
Posted to
C#
(Forum)
by
Aleyna
on 4/6/2009
Filed under: string concatenation, c# 3.5, double addition
Re: Authenticated WCF with AJAX
Hey ;) it took really long time to get all these answers but anyways thanks for your share and help : ) [quote user="cb3431"] Did you find a way to do this? [/quote] First you need to activate ASP.NET compatibility on WCF and then you can use ordinary path based authorization as mentioned in the previous post. To host a WCF service in ASP.NET compatible mode, have a look at the following page http://msdn.microsoft.com/en-us/library/aa702682.aspx basically use AspNetCompatibilityRequirements
Posted to
ASP.NET AJAX Networking and Web Services
(Forum)
by
Aleyna
on 7/17/2008
Authenticated WCF with AJAX
Hi all, I want to use .NET AJAX framework with WCF services. I got stuck at a really critical point due to lack of experience :-) Now that, in order to use any feature at website user must be authenticated. This is done with standart asp.net not with ajax and then home page is displayed. In my secret page, I want only the authenticated users can be able to use any WCF service that I deploy to the website, in other words anonymous access will not be allowed. Service header, sessionId or any other
Posted to
ASP.NET AJAX Networking and Web Services
(Forum)
by
Aleyna
on 3/4/2008
Filed under: ajax, asp.net, WCF, Authentication, webservice
Re: Announcing - SQL Server Database Publishing Wizard CTP 1
;) Good to hear. Very appreciated. I will have a look at it
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
Aleyna
on 6/3/2007
Re: Urgent: mssql error need help
Problem solved. The catch is that this error is thrown only when I logged in so I focused on the providers that are triggered after login process. It is only RoleManager to deal with. First I checked RoleManager section in web.config and I noticed that I have no connectionStringName attribute assinged and it tries to use default one, that is LocalSqlServer. Therefore I user the following lines to solve the problem. To ensure this never gonna happen again. I used this XMembershipConnStr is assigned
Posted to
SQL Server, SQL Server Express, and SqlDataSource Control
(Forum)
by
Aleyna
on 6/3/2007
Page 1 of 2 (14 items) 1
2
Next >
ASP.NET:
T4CSS: A T4 Template for .Less CSS With Compression
Channel 9:
Photosynth Update and New UI
Channel 9:
First Look: Streetside in Bing Maps
Channel 9:
Coding4Fun at PDC 2009
WindowsClient:
10 Must-See PDC 09 Sessions
Channel 10:
Photosynth Updated with New Release and New UI
Channel 10:
WindowsBlinds 7 Now Works with Windows 7
Channel 10:
Zune HD Launches New Colors
ASP.NET:
PDC09: ASP.NET MVC 2: Ninjas Still on Fire Black Belt Tips
ASP.NET:
Hanselminutes Podcast 188: ASP.NET MVC 2 Beta with Phil Haack
ASP.NET:
Hanselminutes Podcast 186: .NET Debugging 101 with Tess Ferrandez
TechNet Edge:
WinRE and free stuff with Sean Kearney
WindowsClient:
XslCompiledTransform and large template elements
WindowsClient:
The Future of Client App Dev : WPF and Silverlight Convergence
Channel 9:
PDC09 GeekFest Party
Channel 10:
How to Use "Play to" and "Remote Media Streaming" in Windows 7
Channel 9:
The Visual Studio Documentary: Jeff Hadfield Full Length Interview
TechNet Edge:
Managing Your Entire World - Tech Focus November 2009 Part 3
Channel 9:
The Access Show: Managing Access Databases with SharePoint
ASP.NET:
Hacking the ASP.NET Parser
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online