.net

Can anyone give me a little explanatory example about InsertOnSubmit and InsertAllOnSubmit

Hi, I am trying to understand difference between those two and really need a explanatory simple example for them. Thanks in advance.. ...

Simple Active Record Implementation in .NET 2.0+

I'm looking for a very simple example of active record in .NET (code samples to be honest) ...

How can I read a "drive label" or "volume name" in .NET?

Can you show sample code for reading a drive label or volume name in .NET? I get the sense this requires WMI, but I am loathe to "drop-down" into WMI because it is like dropping down into a string-based SQL query in the sense that certain objects may not exist on certain versions of OSes or the user may not have the right to query certai...

Differences between Excel 2003 and 2007 from a VSTO perspective

What are some of the major differences to be aware of when developing Addins or Document level customizations for excel 2003/2007? ...

.NET Processing spawning issues

I have an executable that runs instantly from a command prompt, but does not appear to ever return when spawned using System.Diagnostics.Process: Basicly, I'm writing a .NET library wrapper around the Accurev CLI interface, so each method call spawns the CLI process to execute a command. This works great for all but one command: acc...

Software to simplify displaying build status on a big visible monitor for team?

I had a little bit of budget left at year end and I wanted to start a little skunk works project to display build status what everyone was working on (our team is aobut 10 folks all told). I am thinking to buy a 47" LCD HD TV and drive it from a small pc via a browser/.NET web application. I was going to build the software over the chr...

How can I find the primary key columns of a table using ado.net?

Is there a pure .net way to do this reliably? The solutions I keep finding either require guessing or they have a solution that is specific to a database provider. Usually querying some internal system table to get this information. ...

String Immutability

Does string immutability work by statement, or by strings within a statement? For example, I understand that the following code will allocate two strings on the heap. string s = "hello "; s += "world!"; "hello" will remain on the heap until garbage collected; and s now references "hello world!" on the heap. However, how many strings...

Looking for a .NET "text" editor control.

My boss is looking for a .NET text control to build a custom editor on. Here’s what we need it to do: Supports embedded tables, with easily editing (like Word tables). Supports different text styles (font, size, color, background, etc). Ability to programmatically set styles, both on first load, and as file is edited. Supports key/mous...

Best .Net Polling/Survey Software

Can anyone recommend a good polling/survey solution for use on a .net web application? ...

Where do Java and .NET string literals reside?

A recent question about string literals in .NET caught my eye. I know that string literals are interned so that different strings with the same value refer to the same object. I also know that a string can be interned at runtime: string now = DateTime.Now.ToString().Intern(); Obviously a string that is interned at runtime resides on t...

How to block the UI thread from another thread or force a form to run within the UI thread

A requirement for my application is if it looses database connectivity then it must pop up a big modal "No Connection. Try again later" dialog blocking all user interaction until such time that connectivity is regained. I achieve this by at the start of the application starting an instance of a DeviceMonitor class. This class creates ...

How does one create a WPF MarkupExtension with non-string parameters?

I am working on a Custom MarkupExtension within a WPF application. Every documented example I have seen uses string parameters from XAML to construct the new object. Is it possible to use a non-string parameter? In other words, how can I do something like this? [MarkupExtensionReturnType(typeof(Uri))] public class RefPackUriExtension...

MDI Pros & Cons

I have inherited a application framework from the previous developer where I now work. This framework utilizes multiple parent/child relationships. In many instances parent/parent/child occur. I asked why he WASN'T using MDI and he stated that years ago, when he had started, MDI had major shortcomings concerning the previously stated ...

Convert string to Brushes/Brush name in C#

I have a configuration file where a developer can specify a text color by passing in a string: <text value="Hello, World" color="Red"/> Rather than have a gigantic switch statement look for all of the possible colors, it'd be nice to just use the properties in the class System.Drawing.Brushes instead so internally I can say something...

How do get some of the object from a list without Linq?

I am running C# framework 2.0 and I would like to get some of the data from a list? The list is a List<>. How can I do that without looping and doing comparaison manually on each element of the List<>? ...

How do you databind to a System.Windows.Forms.Treeview control?

I'm looking at this control, and it seems to be lacking the standard .net "datasource" and "datamember" properties for databinding. Is this control not bindable? I can write some custom function that populates the treeview from a given data source, I suppose, and embed data objects as necessary, but is that the 'best practice'? Or doe...

Path.Combine for Urls?

Path.Combine is handy, is there a similiar function in the framework for Urls? I'm looking for syntax like this: Url.Combine("Http://MyUrl.com/", "/Images/Image.jpg") ...Which would return: "Http://MyUrl.com/Images/Image.jpg" ...Of course string concatenation would be fine here since the '//' would be handled intelligently by the br...

Refactoring tool in VS 2008?

At University we have VS 2005 and it has some refactoring tool like rename, extract method, extract class, etc. I have decide to download VS 2008 from MSDN and it has only Rename and Extract method, how can I activate the other? EDIT: I have downloaded Microsoft VS 2008 C# Express Edition. ...

WinForms: How to programatically fire an event handler?

i want to programatically invoke an event handler for a control. For example: DateTimePicker dtpLastConsummated; i want to trigger the TextChanged event handler for the dtpLastConsummated, how can i do it? In other languages i would call something akin to: dtpLastConsummated.TextChanged(this, new EventArgs()); but in .NET you can ...