.net-2.0

Finding distinct lines in large datatables

Currently we have a large DataTable (~152k rows) and are doing a for each over this to find a sub set of distinct entries (~124K rows). This is currently taking about 14 minutes to run which is just far too long. As we are stuck in .NET 2.0 as our reporting won't work with VS 2008+ I can't use linq, though I don't know if this will b...

Non-LINQ implementations of Union, Intersect, and Except

LINQ to objects has the incredibly useful Union, Intersect, and Except methods. Sadly, there's a client I'm doing work for and they are mandating .NET 2.0 so LINQ is not an option. I looked through the reflected code and it didn't reverse well at all. Is there a .NET 2.0 library or easy implementation of Union, Intersect, and Except? ...

FileNotFoundException thrown when calling Assembly.GetExportedTypes()

I'm getting this error when running a .net 2.0 app on a stripped-down XP SP3 x86 virtual machine, even if .net 2.0 framework runtime has already been installed prior to installing the app. Exception Source: mscorlib Exception Type: System.IO.FileNotFoundException Exception Message: Could not load file or assembly 'Windo...

Change Code to .net 2.0

hi It seem that .net 2.0 do not support OrderByDescending for dictionary keys , how can I change this code to .net 2.0 private static Dictionary<byte[], Func<BinaryReader, Size>> imageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>>() { { new byte[]{ 0x42, 0x4D }, DecodeBitmap}, { new byte[]{ 0x47, 0x49...

LinkedList, First and Last

I have a question about LinkedList<>. There are properties of this list First and Last. Will that properties correct if I will set Last.AddNext(First)? I need to have a list where Last>Next = First, but identify clearly the First and Last elements. I have a cycle process.NextStep, NextStep, but need to be able to identify each Step (p...

check whether array contains false?

How to check the array true_or_false containing a value of false? bool[] true_or_false = new bool[10]; for (int i = 0; i < txtbox_and_message.Length; i++) { bool bStatus = true; if (txtbox_and_message[i] == "") { bStatus = false; } true_or_false[i] = bStatus; } ...

How can I call a webservice from C# with HTTP POST

I want to write a c# class that would create a connection to a webservice running to www.temp.com, send 2 string params to the method DoSomething and get the string result. I don't want to use wsdl. Since I know the params of the webservice, I just want to make a simple call. I guess there should be an easy and simple way to do that in ...

Setting Timer Interval to Infinite

I have a method that links a BO Connection.AliveInterval to a System.Timers.Timer (.NET 2). Some connections are managed to be always connected. Is it OK to set in such a case if (myConnection.AliveInterval == Connection.TimeInfinite) { myTimer.Interval = double.PositiveInfinity; } ? Should I expect that the Timer will throw ...

How to add custom information in detail pane of win vista and win 7 using c#.net

Hi, i have a file type for my application for which i want to show some custom information in Organize\Deatails Pane in windows explorer. Like for a word file it shows author and stuff similarly i have some custom information for my file which i want to show. Anybody with idea on how can i do it? ...

VB.net - creating a hashtable with values

Is it possible to create a hashtable "pre-populated" with values? i.e. something like: dim myHash as new Hashtable() = {"key1", "value1", "key2", "value2" } ...

Upgrading a .Net 2.0 project to .Net 4.0

I have a .Net 2.0 project that depends on many 3rd party .Net dlls (all of which obviously target .Net 2.0). If I were to migrate my project to VS2010 and target the .Net 4.0 framework, will my app still build? Or will it complain about the .Net 2.0 dll references and I will have to find .Net 4.0 versions of these 3rd party dlls? ...

string array.Contains?

.NET 2 string[] myStrings = GetMyStrings(); string test = "testValue"; How can I verify if myStrings contains or not test? ...

Generate static web pages from a template as part of ASP.NET Web application build

I'm building an HTML5 application (with ASP.NET back-end) and i want to develop it in such a way that i can run it locally with all my resources (such js and css) not minified (so i can debug it easily). However when i build the final version i want merge and minify the resources. At the same time i want to create several versions of the...

How to Clear the Clipboard Contents using c#

I have an application where i am using Clipboard for copy, paste operations. For copying i have used this code Clipboard.Clear(); const byte VK_CONTROL = 0x11; keybd_event(VK_CONTROL, 0, 0, 0); keybd_event(0x43, 0, 0, 0); //Send the C key (43 is "C") keybd_event(0x43, 0, CONST_KEYEVENTF_KEYUP, 0); keybd_event(VK_CONTROL, 0, CONST_KEYEV...

.NET Windows 7 specific errors

I have a .NET application and a setup fot it. Built using VS 2005. The development machine is Windows XP SP3. Once somebody installed it under Windows7. And get the following errors WinForm ThreadException System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memo...

How to open a new form from another form.

I have form which is opened using ShowDialog Method. In this form i have a Button called More. If we click on More it should open another form and it should close the current form. on More Button's Click event Handler i have written the following code MoreActions objUI = new MoreActions (); objUI.ShowDialog(); this.Close(); But what...

DataGridView: How to enable multi row select but disable multi cell select?

Hello everyone, I'm looking for a way to enable multi row select in a DataGridView-Control but disable multi cell select. What I've tried so far: DataGridView.MultiSelect = true allows to select multi rows and cells ClearSelection() in DataGridView_CellMouseClick-Event and re-select the last selected cell doesn't look very nice (you ...

Using Bit.ly API in ASP.NET 2.0

Hey I was wondering if anyone can point me to some example on how to use Bit.ly API in ASP.NET 2.0 ...

WinSock error occured while downloading mail message as MSG file

My environments are Server Machine: DocuShare Server 6 Client Machine: Windows XP where DocuShare client 6, DocuShare outlook client 3, MS outlook 2007 and our C# application are installed. We have a C# application to download mail message from DocuShare server using DocuShare API. The application successfully downloads docushare mai...

Problem with ToolTip in Windows Form(C#)

I have form with 4 buttons and Image. For all these controls i have added tool tip by using the following code ToolTip objToolTip=null; ..... public Form1() { objToolTip=new ToolTip(); } ..... //Used to set the button lables based on Data from database private void SetButtonlabels() { obj...