.net-2.0

Problem with dynamically generated C# files in msbuild

I have a source XML file that is used to create C# files that are then compiled as part of a project. Currently I have a BeforeBuild target that runs my XML to C# converter. The problem is that by the time the BeforeBuild step is run the old files appear to have been stored by the build system so the new files are ignored. How can I get...

Validation controls for Windows forms?

Are the validation controls available in Visual Studio 2005 for Windows Forms like they are for Web Forms? I don't see them. ...

Cleaning up .NET HTML generation

I am looking to clean up some of the HTML generated by a .NET 2.0 TreeView controller. Switching to another version/model is not an available option. My first crack yielded an extended TreeView, with an overridden Render that Regex'd out the text I didn't need and output to the page. The problem was when I tried to collapse/expanded n...

.Net 2.0 Winform Label Tool Tip

This has got to be something I just missed, but how do I add a tool tip to a label? I saw something on the web about handling the mouse hover event, but how would I even handle it in code? ...

IIS 6/.Net 2:How can user A get the user cookie for unrelated user B who is in a different session and on another box?

1) user A goes to the site, creates an account, and logs in 2) user b goes to the site. Rather than having to log in, user b enters as though user b is user a. User b gets access to all of user a's data and can brows the site as user a. Note: user b does not log in. User b just hits the site, and the site returns as if user b is alre...

What is the best way to parse an XML boolean attribute (in .NET)?

An XML attribute declared as xs:boolean can acceptable be "true", "false", "0" or "1". However, in .NET, Boolean.Parse() will only accept "true" or "false". If it sees a "0" or "1", it throws a "Bad Format" exception. So, given that, what's the best way to parse such a value into a Boolean? (Unfortunately, I'm limited to .NET 2.0 solu...

How does default/relative path resolution work in .NET?

So... I used to think that when you accessed a file but specified the name without a path (CAISLog.csv in my case) that .NET would expect the file to reside at the same path as the running .exe. This works when I'm stepping through a solution (C# .NET2.* VS2K5) but when I run the app in normal mode (Started by a Websphere MQ Trigger...

ASP.NET CompareValidator issue

Hi, I've got a web form with Password and Confirm Password text boxes. I've got a RegularExpressionValidator attached to the first one and CompareValidator to the second one. Now the problem is when i have something in the Password field and nothing in Confirm Password field it does not display an error that fields don't match. As soon ...

.NET 2.0 DataGridView ComboBox column - slow to display items

Hi, Any suggestions on how to improve DataGridViewComboBoxColumn performace with large item sets? I've got a DataGridView with several columns of type DataGridViewComboBoxColumn. I'm databinding those combobox columns to a rather large collection (10k+ items). As a result it's very slow to display the items (when i click on the down-ar...

.NET Runtime 2.0 Error in a service

We have a custom service that writes to a DB (SQL 2005). This is a full 64-bit environment (DB, .NET service). On one of our servers we crash every morning when we have a spike in our volume of data. On another server we run fine. The only differences that I've been able to notice between the two machines is that the one experiencing...

VB date conversion

Is there an easy way to convert a string that contains this: Date: Wed, 5 Nov 2008 13:12:12 -0500 (EST) into a string that contains this: 20081105_131212 UPDATE: I ended up using date.tryparse which is similar to tryParseExact except you don't have to specify the format string. I did have to eliminate the () and the EST for this t...

ASP.NET Refreshing one Window from another

I have a page with a GridView on it that launches a popup, using Javascript. The user then selects an item, that updates the data connected to the GridView and closes the popup. How do I refresh the first (ie the Calling page) so that I can refresh the data shown in my Gridview? ...

Upgrading ASP.NET from version 1.1 to 2.0 - Any Gotchas?

I know we are really behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0. Thank you for your sympathy. Anyhow, are there any gotchas we should look out for? Do you have any general advice before we jump in? Please do not post telling me to go straight to 3.5: 2.0 is all we're allowed! We're usi...

What is the equivalent of the .NET Framework 2.0 SDK for the .NET Framework 3.5?

On our build server, we've installed the .NET Framework 2.0 SDK in order to kick off MSBuild and run our builds. Now we are upgrading to the .NET Framework 3.5. We do not want to install the complete Visual Studio, but we cannot find a .NET Framework 3.5 SDK on the internet either? The question: What do we need ot download and install t...

Why won't my Website Project adapt to .NET 3.5?

We've converted our solution from .NET 2.0 to .NET 3.5. All projects converted just fine except for the Website Project, which still doesn't understand what I mean when using 'var' and the like. I've looked in the property pages for the web project, and the Target Framework is set to '.NET Framework 3.5'. Any other ideas? ...

Why does Log4Net run so slow in my Windows Service?

I have a windows service that uses log4net. We noticed that the service in question was running painfully slow so we attached a debugger to it and stepped through. It appears that each time it tries to write an entry to the log via log4net that it takes anywhere from 10 to 30 seconds before the next line of code can execute. Obviously th...

WaitCursor on sort in DataGridView

I am using the standard .Net 2.0 DataGridView with sort mode of automatic on the column. It is very very slow (which should probably be another question on how to speed it up) but I can't seem to find an event or combination of events that will maintain a WaitCursor while this sort operation is being performed. Ideas? ...

FileSystemWatcher and network disconnect?

How can I make it work in a network? It works then it stops working without reason (maybe because the network isn't perfect). ...

PropertyGrid: getting PropertyValueChanged notifications from a CollectionEditor

The PropertyGrid control is very useful for editing objects at run-time. I'm using it as follows: Form form = new Form(); form.Parent = this; form.Text = "Editing MyMemberVariable"; PropertyGrid p = new PropertyGrid(); p.Parent = form; p.Dock = DockStyle.Fill; p.SelectedObject = _MyMemberVariable; p.Prop...

How do I send ctrl+c to a process in c#?

I'm writing a wrapper class for a command line executable. This exe accepts input from stdin until i hit ctrl+c in the command prompt shell, in which case it prints output based on the input to stdout. I want to simulate that ctrl+c press in c# code, sending the kill command to a .Net process object. I've tried calling Process.kill(),...