.net-2.0

How can i get the path to the common Desktop and Start Menu dirs in C#?

I'm using .NET 2.0. I noticed that there doesn't seem to be a Environment.SpecialFolder member for the common Desktop and common Start Menu folders. i would prefer a way that doesn't involve loading shell32.dll and using SHGetSpecialFolderPath ...

Move a control to a floating location

I want to move a control in panel1 to the Red Line end from the following example: private void panel1_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawLine(Pens.Red, new PointF(10.7f, 20f), new PointF(50.5f, 20f)); } Is that possible in .NET 2.0? Background I draw some paths using the floating (world) coordinate...

Designing forms to work on different resolutions and aspect ratios on Windows CE

I have a .NET 2.0 application that runs on Compact Framework. It has a bunch of different forms that were all originally designed to run on a specific device with a specific screen resolution. I'm now looking to get this application to run on some other devices that have very different screen resolutions (some have completely opposite ...

How to stimulate MouseDown event (not click) in c#?

i have designed a gui calc , i have used flat buttons for thenumbers , to get the button click feel i have changed the mouse down color , but when i use the numpad keys to do calc iam able to stimulate the click event but how do i need to stimulate MouseDown event, ...

In C# .NET 2.0, is there any way to get access to the URL history of a WebBrowser control?

Well, the title is pretty much the whole question. I'd like to be able to clear the WebBrowser controls history on every Navigate - to prevent my users from going back to a previous page. i already disabled the right click menu so they don't have access to the "Back" option, but they could still hit Backspace to go back in history. block...

DataBinding feedback in .NET2

I have a object myObject.Name in a Form1 with a textBox1 In the Form1_Load I do: this.TextBox1.DataBindings.Add("Text", myObject, "Name"); When validating the textBox I have myObject.Name changed. This is OK. Now I modify internally in myObject _name = "changed value", but myTextBox text will not change. so... how to do it on both di...

VS2008 targeting .NET 2.0 doesn't stop me from using C# 3 features

I had a VS2005 solution and wanted to get off VS2005 for the new year. I was mostly happy with the upgrade process and pleasantly surprised to see that my build scripts mostly still worked. My question is around the multi-targeting feature - I don't have .NET 3.5 installed on my servers, so I have to continue to target .NET 2.0. That ...

file not getting deleted programmatically in asp.net

im not able to delete the file programmatically in asp.net.No Error is coming. But even then file is not getting deleted. its very urgent..... ...

Setting Code Access Policy (CAS) on console application running over network

I have a console app written in .NET 2 that uses reflection to dynamically load Assembly files, instantiate an instance of that Assembly, and invoke members of it. I had this app running very smoothly on our current servers, but we're now migrating to a new host, which is a 64-bit machine running Server 2008. The code that is executed, r...

Creating a "merge module" for a web project.

My group uses merge modules on various projects which is then added to a setup project. This simplifies deployment by having only one .msi for our entire suite of functionality and allows us to have one entry under Add/Remove Programs. I cannot find a way to do this with a web setup project given there is no "Web Setup Merge Module" pr...

DataBinding: Validate before change

[.NET 2] Situation: class MyObject { string Max { get{...}; set{...}; } string Min { get{...}; set{...}; } } MyObject myObj1 = new MyObject(); // ... code txtMin.DataBindings.Add("Text", myObj1, "Min"); txtMax.DataBindings.Add("Text", myObj1, "Max"); Problem: Need verifying Min < Max bef...

Asp.net Mvc 2.0 RC Setting Thread CurrentCulture/Ui

I been pulling my hair out all day. i can't seem to set the current thread cultureui or culture to anything other than English. In the controller i have protected override void Initialize(System.Web.Routing.RequestContext requestContext) { base.Initialize(requestContext); CultureInfo cultureInfo = C...

Can you call a .NET 2.0 COM object from an ASP.NET 1.1 web app?

We have an ASP.NET 1.1 web application. It invokes a C++ COM object which in turn invokes a .NET COM object. Originally, this .NET COM object was a .NET 1.1 assembly. Now, we need to modify this .NET COM object and in the process we now use Visual Studio 2008 so it is a .NET 2.0 COM object now. We now find that our ASP.NET 1.1 web applic...

Unique List<T> in .NET 2

What is a (preferably generic) unique(IComparable/IEquitable) valued collection (à la List<T>; ideally a equivalent to HashSet<T> in .NET 3.5 without ordered items) of objects for .NET 2? ...

Using Repeater Control as a command parameter for a nested gridview.

Hi, I have a repeater which contains a nested gridview. Now I need to be able to retrieve a value databound in a label inside of a repeater and use it as an input parameter for the gridview. Here is some code which will hopefully give you a better idea of what I'm trying to do. enter code here <asp:Repeater ID="Repeater1" runat=...

How do I iterate through the Attributes of a C# class (.NET 2.0)?

Say I have a class: public class TestClass { public String Str1; public String Str2; private String Str3; public String Str4 { get { return Str3; } } public TestClass() { Str1 = Str2 = Str 3 = "Test String"; } } Is there a way (C# .NET 2) to iterate through the Class 'TestClass' and print out public variables and a...

EventHandler and Memory Leaks

I analyze a VB.NET project and there are some objects(child MDI form) that are disposed, but not removed by the GC. The MemoryProfiler analysis find between others the following: "This instance is disposed and still indirectly rooted by an EventHandler. This often indicates that the EventHandler has not been properly remov...

.net 2.0: What's the best way to deal with in-memory DataTables?

Hi, I have a csv file that I import into a DataTable. Furthermore I've created a TableAdapter with several queries. Is it somehow possible to execute the queries associated with the TableAdapter directly on the "in-memory" DataTable (doesn't seem so) or do I always have to write the imported DataTable to the database first and then exec...

RemoveHandlers on the base form

I wonder if I can remove all added event handlers in all the child forms from the one base form in the Closing method. (VB.NET; .NET 2.0) Background: In a project I analyze a memory problem. I verified with the memory profile (see related question) and find out that some forms are not collected by the GC, probably because of the EventH...

Help finding a Memory Leak cause

I have the following Leak situation in a VB.NET (.NET2) application: a form - DetailTache (TaskDetails) - in my MDI application is not garbage collected is not collected ofter open/close. I did the following profiling root: any idea how this leak could be fixed? thanks. EDIT: Result search from projet of WinComboRowSelected Event....