FAQ Database Discussion Community


Register event handler for specific subclass

c#,.net,events,.net-2.0
Ok, code structure question: Let's say I have a class, FruitManager, that periodically receives Fruit objects from some data-source. I also have some other classes that need to get notified when these Fruit objects are received. However, each class is only interested in certain types of fruit, and each fruit...

Find all k-size subsets with sum s of an n-size bag of duplicate unsorted positive integers

c#,algorithm,.net-2.0,dynamic-programming,subset-sum
Please note that this is required for a C# .NET 2.0 project (Linq not allowed). I know very similar questions have been asked here and I have already produce some working code (see below) but still would like an advice as to how to make the algorithm faster given k...

How to create Unit Test in .NET 2.0 VS2013?

unit-testing,visual-studio-2013,.net-2.0,nuget-package
I have tried microsoft unit test package from nuget ,but it's failed to install, so please help, how to use unit test in visual studio using any package.

Decimal value delimiter issue

c#,sql-server-2008,.net-2.0
Not sure how to describe the issue in the title. I'm saving a price (decimal only, not currency format) to a SQL db. On Windows 8 computers, if there is a decimal value, the value will move to the left, and become a .00 decimal. For example: 120.34 will become...

Multithreading Fill Array

c#,arrays,multithreading,.net-2.0
on C# Net 2.0 Code works slightly slower then single threaded version. xDiff = 2100, yDiff = 2000; Almost 14 sec in single threaded, 16 sec in multithreaded (this code). Something must be wrong. I need to fill result array. Only one time writes data on node of array, no...

Upgrading crm 4 plugins project from visual studio 2005 to visual studio 2010

visual-studio-2010,plugins,visual-studio-2005,.net-2.0,dynamics-crm-4
I have a visual studio 2005 class library project with the plugins for a microsoft crm 4 installation. I want to upgrade the project to visual studio 2010 but I still have to use the .net 2.0 platform. I tried to convert using the VS2010 wizard and the project is...

XML Parsing. Hide Parent node

c#,xml,parsing,treeview,.net-2.0
So I have an xml file parsed to a TreeView list, currently I have about four levels of nodes when I only want three. I want to hide/remove the parent node or the top node since it's not much useful. I could do that by editing the XML file itself,...

Where do these 1k threads come from

c#,multithreading,unity3d,.net-3.5,.net-2.0
I am trying to create a application that multi threaded downloads images from a website, as a introduction into threading. (never used threading properly before) But currently it seems to create 1000+ threads and I am not sure where they are coming from. I first queue a thread into a...

MultiThread on For Loop C#

c#,multithreading,.net-2.0
I am making a program to check Status of my company servers. My servers infor will load in DgvServer I use for loop to check status of servers: private void btnCheck_Click(object sender, EventArgs e) { try { string ip = ""; Ping ping = new System.Net.NetworkInformation.Ping(); PingReply pingreplay = null;...

List.Find Method in a VB.NET2

vb.net,.net-2.0
Using VB in .NET2 Public Class GroupSID Private _groupName As String Private _sid As String Public Property GroupName() As String Get Return _groupName End Get Set(ByVal value As String) _groupName = value End Set End Property Public Property SID() As String Get Return _sid End Get Set(ByVal value As String)...

Using WCF in .net 2

wcf,.net-2.0,wshttpbinding
I've got a method of connecting and use a WCF method, which is on HTTPS and requires a username and password in .net 4. Now I need to do the same but within .Net 2 and I can't seem to get it to work. I keep on getting the below...

IBM i (AS/400) command works locally but not remotely

oledb,.net-2.0,ibm-midrange
I have a Windows service written in VB.NET 2.0 which connects to an IBM AS/400 server. Queries work fine, but when I try to do something like deleting a spool file, I get errors. For example: CPYSPLF FILE(PO630A) TOFILE(MPLCDATPAR/PO630APF) JOB(083064/ARUSER/POASYNCMON) SPLNBR(80) MBROPT(*REPLACE) Running this command with ExecuteNonQuery yields: CPF3342 -...