.net

GridView Checkbox Column

I used to have a class in 1.1 for the Datagrid that inherited from the DataGridColumn class. This allowed me to create a check box column with a client-side un/check-all box in the header. Then as I designed my grid I would just add my custom column. I am currently on a project where I need similar functionality for the grid view, howev...

How to manually drop down a DataGridViewComboBoxColumn ?

I have a DataGridView with one DataGridViewComboBoxColumn in my WinForms application. I need to drop down (open) this DataGridViewComboBoxColumn manually, let's say after a button is clicked. The reason I need this is I have set SelectionMode to FullRowSelect and I need to click 2-3 times to open the combo box. I want to click on the co...

What is the worst gotcha in C# or .NET?

This question is similar to this one, but focused on C# and .NET. I was recently working with a DateTime object, and wrote something like this: DateTime dt = DateTime.Now; dt.AddDays(1); return dt; // still today's date! WTF? The intellisense documentation for AddDays says it adds a day to the date, which it doesn't - it actually r...

Programmatic remote app installation

Is there anything built into Windows and the .Net framework for programmatically installing and executing applications remotely? Ie: an API for remote software deployment. I'd like to build a tool that can install services on a pool of new computers from one central admin workstation. Update: The computers are part of an internal IT net...

How to get xpath from an XmlNode instance. C#

Could someone supply some code that would get the xpath of a System.Xml.XmlNode instance? Thanks! ...

XmlReader - Self-closing element does not fire a EndElement event?

I am using XmlReader in .NET to parse an XML file using a loop: while (xml.Read()) { switch xml.NodeType { case XmlNodeType.Element: //Do something case XmlNodeType.Text: //Do something case XmlNodeType.EndElement: //Do something } } I was wondering if it was normal that the following XML code ...

How do you convert a string to a byte array in .Net

I have a string that I need to convert to the equivalent array of bytes in .NET. This ought to be easy but I am having a brain cramp. ...

Get the names of attributes from an element in a SQL XML column

For this xml (in a SQL 2005 XML column): <doc> <a>1</a> <b ba="1" bb="2" bc="3" /> <c bd="3"/> <doc> I'd like to be able to retrieve the names of the attributes (ba, bb, bc, bd) rather than the values inside SQL Server 2005. Well, XPath certainly allows this with name() but SQL doesn't support that. This is my chief complaint wi...

What is the scope of finalizer thread - per application domain or per process?

Based on all my reading there should be one GC thread to invoke all finalizers. Now, the question is what is the scope of this "one" thread - per process or per application domain, as the whole intention of domains is to separate and make "independent" different applications in one process space. I read here: If an unhandled excepti...

How can I rollback clickOnce if I have a minimum required version?

We decided to use the minimumRequiredVersion in our clickOnce application manifest, and now when we try to rollback to a previous version when the user launches the application it fails to start. It says the application manifest has a earlier version than the required version and the user can not use the application. We did not have this...

Highlighting Text in a .net Webbrowser Control

I'd like to highlight certain words in the document displayed in an embedded webbrowser control. I can envision a solution where the innerhtml property of the document is modified to add a colorizing < span > tag around the desired text, but I can't help feeling that there must be a simpler way? ...

What are your favorite open source or free library for .NET Charts and Gauges?

For a in-house hardware monitoring utility, I need to use gauges and charts to help visualize various metrics. Is there any good open source or free charting and gauge library available for .NET? I am not interested in purchasing any components (which excludes components such as Dundas Charts & Graph, which I know would do the job, but w...

Parse DateTime with timezone of form PST/CEST/UTC/etc

I'm trying to parse an international datetime string similar to: 24-okt-08 21:09:06 CEST So far I've got something like: CultureInfo culture = CultureInfo.CreateSpecificCulture("nl-BE"); DateTime dt = DateTime.ParseExact("24-okt-08 21:09:06 CEST", "dd-MMM-yy HH:mm:ss ...", culture); The problem is what should I use for the '......

VB runtime functions in VB.NET for VB6 programmers

Hi, I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform. My primary concern is to teach my students the best practices for developing in .NET, and I am wondering about whether to consider the use of the VB runtime functions VB.NET legitimate or not. I have read that many of th...

NCover on 64-bit system

What do you suggest to use for code coverage on 64-bit environment. It seems that NCover supports 64-bit only in Enterprise version which seems to be quite expensive. Or isn't it? What are people using on 64-bit systems for .NET code coverage? EDIT: I am aware of the CorFlag workaround. I would like to know what others are doing/using. ...

How to change culture to a DateTimepicker or calendar control in .Net

how to set internationalization to a DateTimepicker or Calendar WinForm control in .Net when the desire culture is different to the one installed in the PC? ...

"HTTP status 401: Access Denied" error for web service even when the virtual directory allows Anonymous access

i have a web service hosted on another server with the Anonymous Access CheckBox in IIS is already checked. when my local web application is trying to access the web service, i still get the "The request failed with HTTP status 401: Access Denied." error. my web application is calling the web service like the following: MyObject.WebSer...

Which is more efficient way to assign values to variables in .NET?

This is something that I have always wondered about, but never bothered to profile. Is it more efficient to assign a value to a temp variable, than to keep using that value. An Example may be clearer: string s = reader.GetItem[0].ToString(); someClass.SomeField = s; someOtherClass.someField = s; OR someClass.SomeField = reader.Get...

Where should I download corflags.exe from?

I'm running Windows Server 2008 64-bit "workstation" and would like to get corflags.exe. Which SDK do I need to download? Edit: I know about .NET Framework 2.0 Software Development Kit (SDK) (x64) and Windows SDK for Windows Server 2008 and .NET Framework 3.5 but I was hoping to find something smaller as these are quite large downloads...

Multi Column Listbox

Hi, Is there a way to bind a Generic List to a multicolumn listbox, yes listbox...I know but this is what I am stuck with and can't add a grid or listview. Thanks ...