.net-2.0

VB.NET - AddressOf returns Nothing?

Hi, Short question: can VB.NET operator AddressOf return Nothing in any case? ...

debug:pdbonly difference between .Net 2 and .Net 4

Hello, I followed this example from Scott Hanselmans webpage: http://www.hanselman.com/blog/ReleaseISNOTDebug64bitOptimizationsAndCMethodInliningInReleaseBuildCallStacks.aspx My goal is to get the line number from where the exception is thrown not where it is caught. When I compile the code with the following build-script it wont wor...

Does boolean.ToString() behave differently between .NET 2.0 & .NET 3.5

I've inherited a piece of code at work and I've just noticed a fairly trivial but bizarre little quirk with it. So maybe someone can save me setting up clean .NET 2.0 Environment to test it out. There is a SQL2K5 table containing a column called IsEnabled BIT NOT NULL There is a sproc selecting from that table There is a piece of C# c...

Why is my call to Runspace.Open() not returning?

I am trying to integrate some new code I wrote for programmatically interacting with Exchange 2010 via Remote Powershell into an existing WinForms application. My code works in an isolated test application, but when I run the code in the context of my app the call to Runspace.Open() blocks for a very long time -- well past the OpenTimeou...

How do you bind a data field value to a combobox index?

This may have been already asked but I can't seem to find this specific question, so here goes... I have a form in C# where every textbox is bound to a field in a row. Rows can be cycled through by some buttons on the bottom but all the data displayed at a time in the from is from one row. Any changes that are made get updated back to...

Combobox appearance

Can I change the appearance of a Winforms ComboBox so that a Combobox with DropDownStyle = DropDownList looks more like one that is DropDownStyle = DropDown. The functional difference between them is that the former doesn't allow for user entered values, the problem is that it's default color scheme looks grayed out and doesn't match wi...

how do I delay action on mouse enter rectangle c#

I would like to delay an action by several seconds after a mouse pointer has entered and remained for period of time in a winform graphics rectangle. What would be a way to do this? Thanks c#, .net 2.0, winform ...

Can ConfigurationElementCollection object contain for its elements another ConfigurationElementCollection objects?

Can ConfigurationElementCollection object contain for its elements another ConfigurationElementCollection objects? I have this xml where testsection is section root: <testsection> <head> <metaData> <metaGroup id="general"> <meta name="Content-type" content="text/html; charset=utf-8" type="http-eq...

WinForms ListView.HideSelection property has no effect?

I'm working on an application in which a list view is used to select what set of data to display. When the user clicks a list item, the main view updates with the data associated with the selected item, and the ListView control loses focus. Upon losing focus, the control stops highlighting the selected item even though I've explicitly se...

VB.Net 2005, how can I subtract a date from the (current date minus 7 days) and produce a number of days ?

I have a date in the future e.g. 13/10/2008 I need to subtract the current date (today is the 28/09/2010) minus 7 days, so thats 21/09/2010 minus 13/10/2008, which would equal erm, 720 something ? But the current date won't always be 28/09/2010, obviously. I need the code for this. EDIT: When i said future I mean past :) ...

How can I convert this string to a date 21/08/2008 00:21:00 ?

I'm using vb.net 2005. How do convert this date / time 21/08/2008 00:21:00 to a DateTime object ? ...

Simple UI issue in winforms

Hi I have a simple winforms application, on performing operations it shows a child window everytime. If I open a browser window (fully maximized) or some other window as usual the application goes back with its childwindow, on clicking the exe which is in the taskbar only the child window gets visible,but the application window doesn't ...

How to manage worker thread who wait until they have work to do ?

I have a program that does the following: Call webservice (there are many calls to the same web service) Process the result of 1. Insert result of 2. in a DB So I think it should be better to do some multithreading. I think I can do it like this: one thread is the master (let's call it A) it creates some thread which calls the webs...

What use is the Tag property in .net

I have noticed the Tag properties with controls. Is it okay to use this to reference my custom objects, or should I stay away from it as it would require boxing and unboxing which has been mentioned as unsafe and is not recomended. TreeNode tn = new TreeNode (); CustClass o = new CustClass() o.number = 123; tn.Tag = o; class CustClas...

Linking to a .Net v2.0 assembly from a .Net v4.0 assembly also appears to link (and alias) mscorlib v2.0. Why?

I have a .Net assembly which imports an assembly linked against the v2.0 runtime. The problem I'm having is that when I try to run some tests on my assembly, Fusion trys to load the wrong version of a dependent assembly. After looking at the assembly manifest, I can see why: the wrong version of FSharp.Core is linked. In my build file,...

VB.Net .net 2.0 Multiple programs each running threads on xp, will vb.net 2010 be better?

In the past few weeks, to speed up our database freshening process, I've created a couple of extra programs, basically copies of the exe file. The program itself, accesses web pages, images etc and uses threads to do so. The second program uses LIMIT 300,100 and the third LIMIT 600,100, to make sure they don't work on the same records. ...

vb.net 2005, threading file locking issue, I think

I'm using vb.net 2005, I've got the following code running a thread to download a file. However, the process fails sometimes when trying to read the local copy of the file. I think I may need to unlock the local file somehow but I'm not sure how to do this. Can someone take a look and advise me ? Dim BP1Ended As Boolean = False Private ...

How to solve this error: Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version 2.0.50727.0'

This question to which I already found the answer is posted here in case of someone else encounters it. I decided to post the Q&A here so that SO has something about this error, since I don't know if it's been here before. This occured after an update of the .NET Framework. Before the update, everything compiled just fine! After the u...

Can I add ony specific WCF endpoints to a .NET 2.0 project as web references?

Hi, I'm developing a .NET 2.0 client application that needs to connect to a WCF service. I add a web reference to a basicHttpBinding WCF service that we've developed and VS creates the proxy class and the config paraphenalia which is fine. The problem is that I only want to use a small fraction of the methods that the WCF service implem...

VB.NET Delegate doesn't work

In my application, I have a MainWindow with a ToolStripProgressBar and a ToolStripStatusLabel. This properties: Property ProgressBarPercantage() As Integer Implements BCSXPSearchTool.Presenter.IMainView.ProgressPercentage Get Return Me._progressbarpercentage End Get Set(ByVal value As Integer) Me._progressba...