.net-3.5

Comparing dates in Entity SQL

What is the correct eSQL syntax to compare dates? The equivalent LINQ-to-Entities expression would look something like this: var lastYearsShipments = from p in MyDataServiceContext.Products where p.ShipDate.Value.Year == DateTime.Now.Year - 1 select p; ...

Install order: Sharepoint ajax and .NET 3.5 ajax

As far as I know Sharepoint 2007 uses ASP.NET Ajax 1.0 with System.Web.Extensions 1.0 while I'm creating webparts with VS2008 SP1 and .NET 3.5 SP1 which includes System.Web.Extensions 3.5. So what is the order of installation and how do you install to get both versions working? ...

Using [0] or First() with LINQ OrderBy

If I have a structure like this  Albums     - Album         - Discs             - Tracks and I want to order a collection of albums by the title of the first track on the first disc. Is there something similar to the following I could do (keeping in mind I need to use the OrderBy extension method that accepts a string)? alb...

Detect Changes webform controls asp.net

Hi all, I have a webform with around 20 textboxes/drop down list controls and i would like a clean and simple way of checking to see if the form fields have changed or not. Does anyone know of a clean way to do this? Thanks in advance! ...

String normalisation

I'm writing some code which needs to do string normalisation, I want to turn a given string into a camel-case representation (well, to the best guess at least). Example: "the quick brown fox" => "TheQuickBrownFox" "the_quick_brown_fox" => "TheQuickBrownFox" "123The_quIck bROWN FOX" => "TheQuickBrownFox" "the_quick brown fox 123" => "The...

Is it possible to serialize objects without a parameterless constructor in WCF?

I know that a private parameterless constructor works but what about an object with no parameterless constructors? I would like to expose types from a third party library so I have no control over the type definitions. If there is a way what is the easiest? E.g. I don't what to have to create a sub type. Edit: What I'm looking for is...

How should I deal with licensed third party libraries in a continuous Integration build?

I am currently setting up a CI Build Server (using CI Factory) for a .NET application that relies on a set of licensed third-party controls. Once I have this working, several other projects will also be set up to build on the same server: these may also be dependent on various third party libraries (possibly different versions of the sam...

What is a good way to shutdown Threads blocked on NamedPipeServer#WaitForConnection?

I start my application which spawns a number of Threads, each of which creates a NamedPipeServer (.net 3.5 added managed types for Named Pipe IPC) and waits for clients to connect (Blocks). The code functions as intended. private void StartNamedPipeServer() { using (NamedPipeServerStream pipeStream = new Name...

Code to check if XP Service Pack 3 Installed (And .net 3.5)

I want to write a program (in vb.net) that checks a customers configuration to make sure that they're ... Running XP service Pack 3 Running .Net 3.0 or above. Give them a warning if they are not running .Net 3.5 or above. or Running Vista Service Pack 1. How would I do this? There is a stackoverflow question asking how to te...

ASP.NET AJAX 3.5 and IE6?

I recently upgraded an ASP.NET app to .NET 3.5 and switched to the newer version of the ASP.NET AJAX library. In FireFox and IE7, everything works great, in IE6, anything that would perform a callback (Partial Refresh, or calling a PageMethod/WebMethod) throws an error: Object Doesn't support this property or method Line: 5175 Char: 9 ...

Programmatically create WPF DataGridTemplateColumn for DataGrid

I would like to be able to programmatically create DataGridTemplateColumns based on my data source. For example, if my source has a date in a particular column I would like to be able to utilize a Datepicker control. I know this is easily accomplished with xaml and a DataGridTemplateColumn at design-time, however, how would I accomplis...

Are the xxxxAsync Methods in .net35 sockets of any benefit when building a socket client app?

I understand the benefits of the new async sockets in .net35 as applys to building socket servers. 1) Please do these benefits apply to building client applications? 2) what would be the recommended way to use the xxxxAsync pattern when building an application that establishes multiple client connections. I would really appreciate your...

.net client profile horror

I read everywhere that the .net client Profile is helping spread .net 3.5 but up to my (now quite big) experience it is not: 1-On many computer it takes up to 1 hour to install , most however takes 30 min 2-the installer is not friendly at all : fast until 11%, blocking for 10 min, then resuming faster, then slowing again with no infor...

How can I get a list of possible transitions for a given role in a state machine workflow?

Hi On a given state machine workflow, how do we find out the possible transitions for a given role. In my scenario, only certain roles have the permission to perform certain activities. I have to get that list. The helper class StateMachineWorkflowInstance isn't helpful here as it just returns all the possible transitions, ignoring the ...

Skip .NET Framework 3.5 language pack download

I downloaded the .NET 3.5 SP1 redistributable package (231MB). On my machine I have more than 1 language pack. When trying to install .NET 3.5 SP1, the installer connects to the internet and downlands language packs. If no internet connection exists, the installer has 5 (depending on how many language packs exists on my operating system...

How do you return a copy of original List<T> from Func<T, TResult>?

I have found out (in a hard way) that a collection that is being enumerated cannot be modified within "Foreach" statement "Collection was modified; enumeration operation may not execute." Now, the solution I came up with is to create a dummy collection of the same size that contains a dictionary key and enumerate over it to modify ...

Supporting .NET Framework 3.5 SP1 Client Profile?

Are there any design considerations that need to be made when targeting the .NET Framework 3.5 SP1 Client Profile? I know it's a subset of the full framework, but what is missing and how will I know if my application will require the Client Profile or the full framework? Has anyone successfully developed an application using the Client P...

Is it possible to create a WCF "reverse" tcp channel?

Normally a WCF TCP channel will make a connect to a host then allow you to make method calls over it. I would like to have a service which makes outbound connections to the clients, but once the connection has been made then clients would be able to make method calls against my service as if it were a conventional connection. I suspect...

DataBind string to DataTemplated checkbox

I want to create a ListBox filled with checkboxes in WPF, and I want to databind the "Content" value with a simple string value. However when I try <CheckBox Margin="5" Content="{Binding}" /> the app crashes. This is what I have. ( I'm sure I am missing something simple ) <ListBox Grid.Row="1" IsSynchronizedWithCurrentItem="True" x:Nam...

Upgrading VS2005 to VS2008

I have a small program <350ish lines of code on 5 forms>. It works fine compiled on VS2005 but doesn't run correctly on Vista. After importing through VS2008, it initially runs correctly. However, there is one main form with four subordinate ones that set the settings and attributes of the starter form. they work correctly until they are...