.net

Why are Array.Sort() and Array.IndexOf() methods static?

Always was interested why are Array.Sort() and Array.IndexOf() methods made static and similar ArrayList.Sort() and ArrayList.IndexOf() are designed as member methods. Thank you for any ideas. ...

How to get a list of all child nodes in a TreeView in .NET

I have a TreeView control in my WinForms .NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can I get a list of all the nodes beneith that parent node? For example, I started off with this: ...

What are some of the major shifts in thinking required to become a good Rich Internet Application (RIA) developer?

I've been experimenting with Adobe Flex recently. Being a long-time server-side web app developer, I'm faced with difficulties that I last experienced when I dabbled in Java Swing development a long time ago. It mainly revolves around the flow of control between my code and the framework's code. Most things are asynchronous as to not fre...

Books on Domain Specific Languages (DSL) for C# .net

I'm looking for good literature(web, podcasts or books) on DSL's in .net and C#. ...

NHibernate mapping to another object NOT on the ID

Ok, NHibernate question here. I have two objects that I would like to map to each other. I have the "Vendor" and the "Township" ... now the two should be linked by zip code, NOT ID. I have done this many times btw objects using id's but never something like this. The issue I am having it that the ZipCodes while stored as strings are so...

Physical path of usercontrol (asp.net)

I have a problem regarding getting the path of a user control. The scenario is as follows: In a aspx i have multiple user controls. In one of those user conrtols i need to loop through the other user controls and get the physical path of them. Is there any easy way to do this? ...

RMI or Web Services sample application

Does anyone know of a sample distributed application (.NET or J2EE) using RMI or Web Services? ...

SecurityException thrown when app starts from remote folder

I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like try { System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Directory.GetCurrentDirectory(); } throw a SecurityException 'Request failed'. What causes this...

Domain Specific Languages (DSL) and Domain Driven Design (DDD)

What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)? ...

How do I trap ctrl-c in a C# console app

I would like to be able to trap ctrl-c in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this? ...

What is the best way to convert an int or null to boolean value in an SQL query?

What is the best way to convert an int or null to boolean value in an SQL query, such that: Any non-null value is TRUE in the results Any null value is FALSE in the results ...

Business Object DAL design

When designing business objects I have tried several different methods of writing the data access layer. Some have worked out better than others but I have always felt there must be a "better" way. I would really just like to see the different ways people have handled the DAL in different situations and their opinon of how the techniq...

How to deterimine whether .Net DLL is used in a GUI app or web service?

How do I determine in a .Net DLL whether it's running in a Windows GUI application or web service? I've got a low level class which is being shared between two applications and need to disable message boxes when it's used in a web service. The Windows application has over 200 solutions and I'm not in a position to re-factor the existin...

Properly file Designer Files in ASP.NET Web Sites

I need to get existing web pages into an existing ASP.NET web site in Visual Studio 2008. I simply tried to drag and drop the whole file folder content into the Visual Studio Solution Explorer or even to copy them into the web site folder. Both ways, Visual Studio seems unable to map the .designer.cs files to the corresponding .aspx (or...

What is the proper way to re-throw an exception in C#?

Duplicate: http://stackoverflow.com/questions/22623/net-throwing-exceptions-best-practices I have a question for you that stems from my partner doing things a different way than I do. Is it better to do this : try { ... } catch (Exception ex) { ... throw; } or this: try { ... } catch (Exception ex) { ... throw ex; } Do they...

Most useful .NET utility classes developers tend to reinvent rather than reuse

I recently read this Phil Haack post (The Most Useful .NET Utility Classes Developers Tend To Reinvent Rather Than Reuse) from last year, and thought I'd see if anyone has any additions to the list. ...

How does WCF deserialization instantiate objects without calling a constructor?

There is some magic going on with WCF deserialization. How does it instantiate an instance of the data contract type without calling its constructor? For example, consider this data contract: [DataContract] public sealed class CreateMe { [DataMember] private readonly string _name; [DataMember] private readonly int _age; priva...

Compiler could not choose an overload between interface and exception

Trying to use an excpetion class which could provide location reference for XML parsing, found an interesting behavior - compiler could not choose between overload which consumes an interface and one which needs System.Exception when I trying to pass XmlReader as a parameter. Detais are following: //exception overloads: public FilterXm...

Getting the whole output of a string that contains chr(0)

Here is the sample: Dim TestString As String = "Hello," & Chr(0) & "World" MsgBox(TestString, , "TestString.Length=" & TestString.Length.ToString) Result - Messagebox shows "Hello," with title says TestString.Length=12 I guess the chr(0) is treated as the end of zero terminated string, but it's not what i want. What the ri...

What is tracing and how should it be done?

What is tracing and how should it be done? I have a common utilities library I am including in my projects and I want to be able to get some output from it. I have been using log4net but would rather not have my common utilities library dependent upon log4net. Does that make sense? Edit: Is there any correlation between logging and tr...