.net

Is there any (performance) difference between Debug and Release?

I'm using MySql Connector .NET to load an account and transfer it to the client. This operation is rather intensive, considering the child elements of the account to load. In Debug mode, it takes, at most, 1 second to load the account. The average would be 500ms. In Release mode, it takes from 1 to 4 seconds to load the account. The ave...

Java is open-source, so what?

Hi all, I always here that Java being open-source is a big benefit, but I fail to see how Java being open-source should draw me to use it as opposed to .NET which is closed-source. This website has some Q&A sections (What is the significance of these developments to the industry? in particular) that give a little info, but is being free...

Suppress the HTTP_X_FORWARDED_FOR http header, c# .net C++

I'm writing an application in C# that uses proxies. The proxies are sending the HTTP_X_FORWARDED_FOR during HTTP requests, and this is unwanted behavior. I am extending the Interop.SHDocVw axWebBrowser (aka Internet Explorer) control right now, but can take another approach if needed for this problem. Is there some way to suppress thi...

problem with treeview

I want to configure the tree view component so that would be the topmost parent node would have no chex box and all the others had. ...

WPF FrameworkElement Parent and Moving a UIElement

I'm trying to move a control from one parent to another (if this will work I'm not quite sure). I can get a hold of the control that I want to move. Here is my code: public void MoveElement(UIElement uiElement) { var element = ((FrameworkElement)uiElement).Parent; //TODO:Remove from parent myControl.Children.Add(uiElement); ...

Zedgraph - determine length of tic on an axis ?

In Zedgraph building a line chart. I have some requirements for axes labels which can't be produced automatically so inspired by this other Stackoverflow answer I'm building a custom axis. I can draw the Axis OK and I can place the labels but I want to draw my own tics. To do this I'd like to know the colour/pen width/size etc of the t...

Create a custom control which has a fixed height in designer

I want to create a custom control (derived from Control class), and when I drag this custom control to a form in designer, I can only change its width. This feature is same as single-line textbox. Please help me. Thanks. Update: My application is Windows Form. ...

Choosing VS2008 .Net 3.5 and .Net 3.5SP1

here is the problem. I have one PC using VS2008 (SP1 ) and another PC using VS2008(normal). I want my .Net projects to be editable in both these PC's. So naturally my projects use .Net 3.5 by default and not .Net 3.5 SP1. So, Is there a way I can fix my VS2008 (SP1) version to stick to .Net 3.5 and not .Net 3.5 SP1. In project propertie...

What is the Difference between GC.GetTotalMemory(false) and GC.GetTotalMemory(true)

Hi, Could some one tell me the difference between GC.GetTotalMemory(false) and GC.GetTotalMemory(true); I have a small program and when i compared the results the first loop gives an put put < loop count 0 Diff = 32 > for GC.GetTotalMemory(true); and < loop count 0 Diff = 0 > for GC.GetTotalMemory(false); but shouldnt it be the o...

problem with closing application

i create my own dialog form with two buttons (ok, cancel) and checked list box. i want to get all selected strings in first form which shown second form. for that purpose i do function GetSelected which return CheckedIndices->GetEnumerator() of my list box. now i want to deselect all strings on pressed cancel button. And deselect all st...

Using Appfabric cache with just one node and HA on

I am looking to use MS-Velocity a.k.a Appfabric Cache in a project that is starting by next month (so I am also assuming Q3 will have a go-live license). The project is a web application which will have at least 40K users in 6 months down. And we know for sure that cache server can be of only one node to start with and we will scale hori...

To check whether the SQL server DB is working properly or not

I need to check whether a SQL Server database is up and running properly using .NET windows application. ...

A code using SharePoint classes doesn't run on systems not having SharePoint installed

I have a window application which uses SP classes to create a site. I works fine on a system having Windows Server 2003 R2 with sharepoint installed. But it doesn't work on a system having XP installed and SharePoint not installed. The fact is that both of these systems are on a intranet. So I assumed that the NON-SP system would be a...

How often do you create implicit conversions for your classes?

Hey there, I've been developing .NET applications for 4 years. So far, I did not need to create any implicit conversions for the classes I authored. Could you provide real-life situations when you could not do without creating implicit conversions? Thank you ...

.NET get timezone by city or by longitude and latitude

Hello, I'm using .NET and I'm able to geolocate user city by IP. Is there easy way to get user timezone by long. and lat. or city name? I wonder how facebook is doing it? Thank You ...

Draw text on a .net Control with negative color of the background - blend

Hi, I'd like to draw a progress bar with percentage in its center, but I'd like the text to have negative (contrasted) color of the background. So the part of the text that is over the filled portion of ProgressBar would be white and the part over unfilled portion would be white. I could do this simply by "cheating" painting the bla...

Is TcpClient BeginRead/Send thread safe?

Using a dotNET TcpClient if I have called an asynchronous BeginRead() on the associated network stream can I still call Write() on that stream on another thread? Or do I have to lock() the TcpClient in the code that is called back from the BeginRead and the code that does the send? Also if I close the TcpClient with: client.GetStream(...

how to convert string to double with proper cultureinfo

Hi All, I have two nvarchar fields in database to store the DataType and DefaultValue, I have a DataType Double and value as 65.89875 in english format. Now I want the user to see the value as per the selected browser language format (65.89875 in English should be displayed as 65,89875 in german). Now if the user edits from german for...

Stepping through ASP.NET MVC in Action (2009) - and stuck on nunit issue

I seem to have missed something - in this step through it talks through downloading nunit and changing the original MSTest reference to NUnit. Which seems fine until it talks about running the test with UnitRun from JetBrains. I would have thought I could run nUnit to be able to run the test - but I load my project in the nUnit gui and...

Any .NET '#region directive' convention ideas ?

I really appreciate the possibility to define regions in your code, as it improves the readability insanely. Anyways, I'd like to have everyone using the same convention in all classes (with the predefined order of all regions) like: Private Fields Constructors Class Properties Event Handlers etc... Do you have any proposition how ...