.net

How to write a ContainsAll query using LINQ? (C# LINQ-TO-SQL)

Suppose i have the following var mustHave = new int [] { 1, 2 } and a table named db.Numbers public class Number { public int id; public int number; } populated with Numbers.add(new Number(){id=8,number=1}); Numbers.add(new Number(){id=8,number=2}); Numbers.add(new Number(){id=8,number=3}); Numbers.add(new Number(){id=9,...

ASP.NET TimeLine Control

I am looking for a free control to display events in a to-scale-timeline. I couldn't get TimeLine.NET to work. Is there anything else I could try? EDIT Any flash or javascript solution would be fine as long as I can put data into it from a database. ...

ADO.NET: DataSet or DataTable and how to retrieve data

SO community I am getting started with ADO.NET and am fairly new to programming. I have had some support already from this community which has been very useful and had another question. In simple terms, I am creating a simple windows form with a combobox of employee names and a button so that when the user clicks the button the select...

How to get an IEnumerable<T1> of members of the class T2 in a Enumerable<T2> using Linq? (C#)

Suppose I have: public class foobar { public int lorem; public int ipsum; } IEnumerable<foobar> items = new List<foobar>(); items.add(new foobar(){lorem = 0, ipsum = 0}; items.add(new foobar(){lorem = 1, ipsum = 1}; How can I get a IEnumerable of all "lorem" in "items" using Linq? ...

In VS.NET why running debug doesn't build all selected project in the active configuration?

Why running debug doesn't build all selected project in the active configuration? Normally I've got some DLLs which are connected to the main project indirectly (MEF) and when I run in debug (F5) VS.NET doesn't build those DLLs. I have to Build (Ctrl+Shift+B) first, then debug the application to debug the current versions of those DLLs....

Uuencode / Uudecode library for .NET or for Visual C++ 6.0?

I have some files that are uuencoded, and I need to decode them, using either .NET 2.0 or Visual C++ 6.0. Any good libraries/classes that will help here? It looks like this is not built into .NET or MFC. ...

Most general way to make a Uri object?

I need to convert all of the following forms into .NET Uri object: "hello.world" "..\something\somthing" "../something/somthing/else" "c:\autoexec.bat" "http://whatever.com/nevermind.html" more or less anything else that you might expect to find in something building local or web path. I have already checked an new Uri("..\somthing\s...

How do I achieve this XML excerpt using .NET

Hi. I'm trying to produce this XML statement (minus the formatting and specific values): <swatchcolor RGB="c5c5c5"> <sldcolorswatch:Optical Ambient="0.520000" Transparency="0.000000" Diffuse="0.800000" Specularity="1.000000" Shininess="0.400000" Emission="0.000000" /> </swatchcolor> I'm using this chunk...

What is .NET RIA Services?

Can someone explain it succinctly? Can it be used with non-Silverlight clients? ...

Can I use predefined namespaces when loading an XDocument?

I often have to deal with XML documents that contain namespaced elements, but doesn't declare the namespace. For example: <root> <a:element/> </root> Because the prefix "a" is never assigned a namespace URI, the document is invalid. When I load such an XML document using the following code: using (StreamReader reader = new Stream...

Serialize and Deserialize an XmlDocument in WCF using DataContractSerializer

I have a WCF service which accepts a string as a paramter for one of its operation contracts. This string however has xml content in it. I need to convert this into a class that is marked as a DataContract but is not exposed to the outside world. I need to use the DataContractSerializer because the class members have the [DataMember...

How to Install a COM using ClickOnce

I have installed my windows application that uses TeeChart ActiveX (a COM Component for charting) using ClickOnce. If I register manually TeeChart using regsvr32 teechart8.ocx, my application works fine. But I want and I need to install the application using ClickOnce. How can I do that? ...

How to learn MVC -- *not* in a web setting

I wish to learn the MVC paradigm and apply it to GUI development (in C#.NET, at least at first, but I think I'd like to apply it elsewhere too). Pretty much every tutorial I've seen so far assumes that if you are thinking MVC, you must be doing web development, and they examine MVC solely from within a web context. I don't give a hoot ...

Castle Logging Facility In 2.0 Release

Does anyone know if there are new binaries for the castle logging facility using the castle windsor 2.0 release? ...

How do you unit test classes that use timers internally?

Like it or not, occasionally you have have to write tests for classes that make internal use of timers. Say for example a class that takes reports of system availability and raises an event if the system has been down for too long public class SystemAvailabilityMonitor { public event Action SystemBecameUnavailable = delegate { }; pub...

What is the proper way to create a Form unobscured by the Windows taskbar?

I dock the taskbar to the left, which causes many windows to open underneath the taskbar. None of the System.Windows.Form.FormStartPosition values take into account the taskbar except for Manual. Is this by design? It's frustrating. I want to respect the default monitor and window position values that the OS should enforce. ...

Process.WaitForExit() causes a NullReferenceException

The following code causes a NullReferenceException tStartParameter = String.Format(tStartParameter, tTo, tSubject) tProcess = Process.Start(New ProcessStartInfo(tStartParameter) _ With {.UseShellExecute = True}) tProcess.WaitForExit() tStartParameter is: https://mail.google.com/?view=cm&amp;fs=1&amp;tf=1&amp;to=t@example...

Data Binding and throwing exception in setter

Hello, Let's say I have a simple class public class Person { public string Name { get; set; } private int _age; public int Age { get { return _age; } set { if(value < 0 || value > 150) throw new ValidationException("Person age is incorrect"); _age = value; } } } Then I want to setup a bi...

how to connect and disconnect usb programmaticaly

hi, i need to connect and disconnect usb progrmmatically , that is i have inserted the usb device i need to transfer the file using C#,.net application ,the application will watch the particular folder and transfer the file from that folder to usb drive. i need to disconnect the usb after the file is transfered and connect the usb wh...

What book on TDD for C# with treatment of Mocks

Can you recoment a book on on Unit Testing and TDD for C# with at least some treatment of Mock Objects? I have seen this question but it does not seem to mention mocking. ...