.net

Naming conventions: Guidelines for verbs/nouns and english grammar usage

Can anyone point me to a site, or give me some wisdom on how you go about choosing names for interfaces, classes and perhaps even methods and properties relating to what that object or method does? This is specifically for Microsoft development, so Java-esque "doGet" and so on isn't really used, however some general rules that cross lan...

Can I create IOC controls using .NET to be placed in web projects?

I currently have a library of UserControls which I use in a lot of our web applications. I would like to update these controls so that I can use IOC to help seperate the logic. So I would have something similar to the following on the web page itself: <prefix:ControlName ID="myControl" runat="server" property="value1" /> And the cont...

How to return the visual studio currently open soution directory

I have a visual studio solution that comprises of several projects and are separated into different directories. In my c# or vb.net code I want to determine the base directory (or the directory that the solution is in). A dirty solution would be to call the directory parent.parent.parent until I find a file *.sln but I also have seve...

Start program on usb hardware plugin

Is there a way to detect when a specific device is plugged into a usb port, what I would like to happen is when I plug my laptop into my docking station it run up several apps to account for my different keyboard, mouse and monitors. Specifically I have an issue with some software for my G15 keyboard stopping media player closing properl...

C#: How to remove namespace information from XML elements

How can I remove the "xmlns:..." namespace information from each XML element in C#? ...

When to use a Array() over Generic.Lists in .NET

when is it appropriate to use an array over a Generic List(of T) in .NET I have struggled to see any benefit an array provides over the Generic List but get the feeling I may be missing something. Performance is one thing that struck me as one potential bottleneck ? Thanks ...

Automating the deployment of a CLR database project to the database

We have a CLR database project in VS08. Right now, everytime we do a build there are multiple manual steps that have to be performed in order to deploy this project as part of our build process. I ended up writing a utility that automates parts of this process. I am wondering if there are are better tools - or even devenv switch that I a...

Best practice of using the "out" keyword in C#

I'm trying to formalise the usage of the "out" keyword in c# for a project I'm on, particularly with respect to any public methods. I can't seem to find any best practices out there and would like to know what is good or bad. Sometimes I'm seeing some methods signatures that look like this: public decimal CalcSomething(Date start, Date...

getting proxies of the correct type in nhibernate

I have a problem with uninitialized proxies in nhibernate The Domain Model Let's say I have two parallel class hierarchies: Animal, Dog, Cat and AnimalOwner, DogOwner, CatOwner where Dog and Cat both inherit from Animal and DogOwner and CatOwner both inherit from AnimalOwner. AnimalOwner has a reference of type Animal called OwnedAnima...

.NET 3.5 security question

I have installed .net 3.5 on a windows 2003 system. I notice that in addition to the latest .net 3.5 level, previous levels of .net such as 1.0 and 2.0 are automatically installed also. These older versions have security issues that I assume are corrected in .net 3.5. Is this correct or do the relevant security patches for these older .n...

.Net Server Clustering Techniques

I want to develop a multi-server clustered framework that will work similarly to the steps below for message flow. From Client Gateway Server Recieves Message Gateway Server sends an ACK Message (UDP) Message is custom deserialized from binary into an object via a factory Message is then routed to a secondary server in the cluster (co...

Can you control the depth of DataContractSerializer deserialization?

I have a pretty sizeable object graph that I have serialized to a file via the DataContractSerializer. I now want to present a list of these files to the user to choose from. In this list, I want to show some of the details about the file, which are properties of the root object. I don't want to load the whole graph into memory, since...

Are SSIS packages thread safe? ie. can be called in parallel?

By default, are SSIS packages thread safe? Can they be called in parallel? (in general) ...

I Can't see my dynamically generated RadioButtonList or CheckBoxList items after postback

Hi All, It's clear wehn I change any control and then posts back the SaveViewState method saves the changes and apply them agian after postback, see the folowing code notice that server-side-code put in a scrispt in my code liske this <% %> switch (myQuestion.QuestionType) { case 0: { rdlistAnswers.Items.Cl...

Is possible to obtain the CSV separator from Thread.CurrentThread.CurrentCulture? (.NET)

In languages where the decimal separator is a ,(comma) the CSV (comma separated values file format) separator is a ; (semicolon). I know where to find this configuration in the Windows Control Panel, but I don't know how to find it progamatically in a .NET application. I guess that Thread.CurrentThread.CurrentCulture has that informatio...

How to diff/merge changes to a deployment project file

I am currently using CVS (not my choice) and have several branches. I'm trying to merge two branches, but a deployment project file has conflicts that I can't resolve without spending a LOT of time. A trivial change to a project file results in drastic changes to that project file - thanks to GUID changes I guess (making a project file...

Creating a Popup Balloon like Windows Messenger or AVG

How can I create a Popup balloon like you would see from Windows Messenger or AVG or Norton or whomever? I want it to show the information, and then slide away after a few seconds. Edit: It needs to be blocking like Form.ShowDialog() because the program exits after displaying the notification ...

Howto bind TextBox control to a StringBuilder instance?

I would like several textboxes to react to changes of an underlying string. So if I were to change the content of the string, all those textboxes would change their content too. Now, I can't use the String type for that as it is immutable. So I went with StringBuilder. But the Text property of a TextBox object only takes String. Is the...

Windows Workflow Foundation or IoC container + Dependency Injection?

I am trying to figure out the internals of the windows workflow foundation. So, we have some software components and we intertwine them in the form of a workflow be it a condition based sequential workflow or a state machine workflow. Now, I am thinking (I may be wrong here) that doesnt the same apply to IoC + Dependency Injection (via U...

How long would it take a non-programmer to learn C#, the .NET Framework, and SQL?

I am not that good at programming. I finished my masters degree in electronics. I want to learn C#, the .NET Framework, and SQL. How much time do you think it would take (if I have 5 hours a day to devote to it)? Also, what order do I learn them in? I have Visual Web Developer 2008, is that enough to begin? Copied from a new question b...