.net

SQL Server Compact Edition and Repository Pattern

I would like use Repository Pattern and MS SQL Compact Edition in my project. My question is which framework or technology do I use for it? Linq2Sql hasn't data provider for SQL CE SubSonic hasn't support for SQL CE NHibernate looks huge for this, I think. I would like use my POCOs. ...

MS Access Query Designer - similar functionality using standard .NET 3.5 controls?

Hello, I would like to achieve something very similar to Microsoft Access query designer - I am talking about a plane(canvas?)-like surface on which users can place and move controls. Is this even possible? If it isn't possible with free .NET controls - then are there any paid ones, which offer similar functionality? ...

What is the .Net equivalent of Java's Dynamic Proxies?

In java it's possible to dynamically implement an interface using a dynamic proxy, something like this: public static <T> T createProxy(InvocationHandler invocationHandler, Class<T> anInterface) { if (!anInterface.isInterface()) { throw new IllegalArgumentException("Supplied interface must be an interface!"); } retur...

Library for reading HTML files as XML (.NET)

Duplicate: Looking for C# HTML parser. Please close. Can you recommend me a library for reading HTML files as XML in .NET? I'd actually prefer to deal with XML objects rather than text. Ideally, it must fix HTML formatting errors. ...

How to serialize a XML without unnecessary spaces and line breaks? (.NET)

I'm using XmlSerializer.Serialize, and it produces line breaks and unnecessary spaces. How to avoid it? ...

Semaphore Counts

In .NET, is there a way to get the count on a semaphore. I don't need a threadsafe count, just a reasonable approximation so report the status on a GUI thread. Currently I'm using a dual-counter. The real semaphore and another variable that is incremented and decremented in sync, but this is annoying and error prone. ...

show definition (browse) in *.pdb of *.dll file

I have built a Library project (DLL) in .NET. And sometimes I use the DLL along with its PDB file as a reference in some other projects. Now in the new project, I cant browse through the code of the DLL to debug. I can only see the definitions of class/methods/variables. That's by using "show definition" by browsing through the "class ...

what is the difference between data adapter and data reader?

What is the difference between data adapter and data reader? ...

How do you do case-insensitive string replacement using regular expressions?

I know precisely zilch about regular expressions and figured this was as good an opportunity as any to learn at least the most basic of basics. How do I do this case-insensitive string replacement in C# using a regular expression? myString.Replace("/kg", "").Replace("/KG", ""); (Note that the '/' is a literal.) ...

Environment.SpecialFolder on foreign windows

Can anyone tell me if Environment.SpecialFolders works correctly on non-english versions of windows. for example. where the SpecialFolder.CommonProgramFiles is not "c:\program files\common files"? ...

Data handling by reading/writing XML with .NET

I'm working on a project that performs physiological simulations using mathematical models. We currently use models defined in MML, JSim's Mathematical Modeling Language, since JSim widely used by researchers. Basically, a model contains variables (with a formula, initial value, and optional units) and constant parameters (with a value a...

ClickOnce requires the assembly MyProject be in the GAC???

I am at a loss for words on this one. Hopefully one of you can clue me in... We've been using ClickOnce deployment in conjunction with CruiseControl.NET for a long time and have not had any hiccups for a long time. Yesterday, I modified was in the References tab on the project's properties and ended up tempted by the "Unused Refere...

C# timer issue

Hello I'm currently having an issue with a timer in a program I'm developing. The timer runs and calls methods which retrieve Windows Management Information from remote PC's after a set period of time and repeat this. The first time the timer calls these all is well, however the second time, after the timer has completed its task, it lo...

Is there a jQuery-like library written in C#?

I love jQuery. I am probably going to have some XML parsing and manipulation using C#. It would be a piece of cake doing it in jQuery. Is there a C# library that implements jQuery's functionality? ...

.NET Unit Testing - Best Practices for hiding test seams in release code

I'm looking for some advice for unit-testing in a manner that doesn't leave "test hooks" in place in production code. Let's say I have a static class (VB.NET Module) named MethodLogger who has a "void WriteEntry(string Message)" method that is intended to write the calling method and a message to a log file on disk. The actual target o...

programming question book for C# developers - algorithms for...

Are there any books for C# developers that will help me to improve my performance answering programming questions during an interview? I need practice, and need to work on algorithm types of questions. ...

Object.GetHashCode

...

Is it possible to prevent controls inheriting the visual style of their container?

Hi, I have GroupBox with its Font set to bold. If I put a TextBox or DataGridView inside the GroupBox when they are displayed all their text also appears in bold. The contained controls appear to inherit the font style of the container. How can I stop this happening, i.e. I want the contianed controls to use the font as specified at de...

WPF ListBox Button Selected Item

I have a listbox with some textblocks and a button -- in the button's codebehind it calls a method passing the currently selected listbox item, this works great. The issue is that when I select an item and then click the button on another item it doesn't update the "SelectedItem" property -- is there a way Xaml or C# that I can force a b...

Where can I find a detailed view of the lifecycle of a Windows Service as developed in .NET?

Where can I find a detailed view of the lifecycle of a Windows Service as developed in .NET? I put my question this way because I am not sure that a detailed enough description can be posted here, but if you think you can please feel free to try. An example of an incorrect answer would be a paste of the description from the MSDN page: I...