.net

WinForm User Controls - Drag Drop

Is it just me... but I thought you could drag/drop User Controls onto WinForms? Can't drag them to the toolbar either. Maybe I'm having a VB6 flashback. It must be missing something simple I'm doing wrong. ...

How do I make the autocomplete list for a TextBox editable?

I have an application with a lot of TextBox controls that use autocomplete. Each one uses AutoCompleteMode.CustomSource to get the autocomplete text from an associated AutoCompleteStringCollection. Whenever the user enters a new value in the TextBox, it gets added to the associated AutoCompleteStringCollection, and at the end of the se...

How to log exceptions in release mode

Stack trace is not enabled when a .net assembly is deployed in release mode. So we cannot get the stack trace from an exception and log it in production environment. For knowing where an exception occurred in the production code and log it, we use a weird approach which I am not comfortable with but I cannot come up with a better soluti...

error running asp.net 1.1 and 2.0 together

So here is the error that I am trying to help a friend with (I don't think I would have tried this). He has a legacy Asp.net 1.1 application. He has already added some ASP.NET 2.0 features to his application. His app is running on a Windows 2003 server. He has the main application running in a 1.1 app pool. In one of the sub folder...

Tools to profile function execution times of a .NET program

What tools are available to profile a .NET program by measuring function execution times and generating graphs to visualize the time spent at various points in the call graph? ...

What does the ProtoInclude attribute mean (in protobuf-net)

In the ProtoBuf-Net implementation, what does the ProtoInclude attribute mean, and what does it do? An example would be appreciated. I saw it in this post and I'm not sure what it does. The example was: [Serializable, ProtoContract, ProtoInclude(50, typeof(BeginRequest))] abstract internal class BaseMessage { [ProtoMember(1)] abst...

Creating multiple instances of Imported MEF parts

Hi, Currently my WPF application imports a part like this [Import(typeof(ILedPanel)] public ILedPanel Panel { get; set; } But this gives ma a single intance of the class that implements ILedPanel. What I really want to do is have the ability to create as many instances that I need. Please note there is only one Export for ILedPanel i...

Symbol servers

In this answer the user suggests using Symbol Servers. Can anyone explain how they work and how to set it up (if possible) with TFS 2008? Thanks ...

linq error

Hi I am working on a mobile.net project. I am trying to make a list of restaurants which is displayed in a drop down list...whn d user selects an item he can add it to d list of favorites. However i am getting an error Description: An error occurred during the compilation of a resource required to service this request. Please review th...

Ultragrid/Winforms Grid Hierarchy problem

I need to create a winforms grid with 3 levels, using infragistics ultragrid. Level 1 has 2 columns (Fixed) ---> Level 2 has 3 columns (Fixed) --------> Level 3 has Infinite no of columns (Dynamic based on type of level 2 item) example Level 1 Item 1 --> 3 Columns (Fixed) Level 1 Item 1 --> Level 2 item 1 --> 3 Columns (Fixed) Lev...

Is there a better way to count string format placeholders in a string in C#?

I have a template string and an array of parameters that come from different sources but need to be matched up to create a new "filled-in" string: string templateString = GetTemplate(); // e.g. "Mr {0} has a {1}" string[] dataItems = GetDataItems(); // e.g. ["Jones", "ceiling cat"} string resultingString = String.Format(templateS...

Disable the reference to entity with XML

I am currently working on program that must read data from a XML stream that some time may contains '&' symbols i.e : <XMLRoot> <Element> <Node> This is a dummy data&more! </Node> </Element> </XMLRoot> When I parse this text I get an error message telling me 'reference to undeclare entity'. Is the...

WPF DispatcherTimer and Mouse Button Click Timing

Consider the following code, I have a textblock that is an "on/off" button in WPF. It's just text inside an ellipse that says ON / OFF. When the user clicks the button and holds the left mouse for ONE second, it will execute the 'turn device on' code if the device is not already powered up. If the user holds the ON/OFF button for three s...

Formatting html dates and numbers on the fly

Hi i have some html like so: <tr> <td><%# Eval("Num") %></td> <td><%# Eval("myDate") %></td> </tr> </table> How can I apply formatting to the first value like: DataFormatString="{0:f4} and to the date like: DataFormatString="{0:dd MMM yyyy} I usually use a dataGrid where I can use the above properties in the ...

.Net 2.0 - ControlPaint.DrawButton uses wrong color

When I call ControlPaint.DrawButton, the button that is drawn is in the non-themed background color. How do I draw a control that looks like a button (including themed drawing) in .Net 2.0 (C#)? ...

Resource File and MissingManifestResourceFileException

Hi, I have problem to make work a resource file. This is my simple code : ResourceManager rm = new ResourceManager("RessourceFile", Assembly.GetExecutingAssembly()); string header = rm.GetString("EmailHeader"); And this is the error : MissingManifestResourceFileException Could not find any resources appropr...

Populating Treeview using Linq

I'm playing with Linq-SQL and would like to display my data in a TreeView on a form. I'm also using .net 3.5, if that matters. Now, my question - is there a better way to populate this treeview? The way I'm doing it now is like this (psuedo): for each order { OrderNode = new TreeViewNode for each product in order { Produ...

Is Silverlight more lucrative than ASP.NET?

Lately I've seen an lot of Silverlight jobs being advertised, with very high rates. Is this just temporary because Silverlight developers are in scarce supply at the moment? Or is there something about Silverlight development that makes it better paid than normal .NET or web development? Or do you think Silverlight will, in the long-te...

Why isn't my DbNull a singleton when I deserialise it using XmlSerialiser?

I've always assumed that DbNull.value was a singleton. And thus you could do things like this: VB.NET: If someObject Is DbNull.Value Then ... End if C#: If (someObject == DbNull.Value) { ... } But recently, I serialised a DbNull instance using the XmlSerialiser and suddenly it wasn't a singleton any more. Type comparison o...

Suggest a good design and architecture book for .Net development

Hi, Anyone please suggest a good design and architecture book for .Net. Is there any book I can refer to which has case studies, examples, etc. so that I can update my knowledge well in this field? In case it's not available for .Net, please suggest in Java also. Thanks in advance Swapna MC ...