.net-3.5

How do I fill a DataSet or a DataTable from a LINQ query resultset ?

How do you expose a LINQ query as an ASMX web service? Usually, from the business tier, I can return a typed DataSet or DataTable which can be serialized for transport over ASMX. How can I do the same for a LINQ query? Is there a way to populate a typed DataSet or DataTable via a LINQ query?: public static MyDataTable CallMySproc() ...

How do I get a distinct, ordered list of names from a DataTable using Linq

Lets say I have a DataTable with a Name column. I want to have a collection of the unique names ordered alphabetically. The following query ignores the order by clause.var names = (from DataRow dr in dataTable.Rows orderby (string)dr["Name"] select (string)dr["Name"]).Distinct(); Why does the orderby not get enfor...

How do you page a collection with LINQ?

How do you page through a collection in LINQ given that you have a startIndex and a count?...

Is nAnt still supported and suitable for .net 3.5/VS2008?

I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server. Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year old now. In short: I am actu...

LINQ on the .NET 2.0 Runtime

Can a LINQ enabled app run on a machine that only has the .NET 2.0 runtime installed? In theory, LINQ is nothing more than syntactic sugar, and the resulting IL code should look the same as it would have in .NET 2.0. How can I write LINQ without using the .NET 3.5 libraries? Will it run on .NET 2.0?...

Where can I get the Windows Workflow "wca.exe" application?

I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename "wca.exe". This is supposed to be able to generate workflow communication helper classes based on an interface you provide it. I can't find that file. I thought it would be in the latest .NET 3.5 SDK, but I just down...

Upgrade to ASP.NET 3.x

I am currently aware that ASP.NET 2.0 is out and about and that there are 3.x versions of the .Net Framwork. Is it possible to upgrade my ASP.NET web server to version 3.x of the .Net Framwork?...

C# 3.0 Where extension method with lambda vs LINQtoObjects to filter in memory collections.

I am prototyping some C# 3 collection filters and came across this. I have a collection of products: public class MyProduct { public string Name { get; set; } public Double Price { get; set; } public string Description { get; set; } } var MyProducts = new List<MyProduct> { new MyProduc...

Extension interface patterns

The new extensions in .Net 3.5 allow functionality to be split out from interfaces. For instance in .Net 2.0 public interface IHaveChildren { string ParentType { get; } int ParentId { get; } List<IChild> GetChildren() } Can (in 3.5) become: public interface IHaveChildren { string ParentType { get; } int ParentId...

Beginners Guide to LINQ

During the beta of Stack Overflow, I have seen quite a few questions about LINQ SQL but know nothing about it... it sounds very interesting. What is LINQ and how do I get started? Links guides or documentation a bonus :) PS: I am a long time C# developer who daily uses Datatables and Parameterized SQL ...

Has anyone run performance benchmarks comparing LINQ

to yesteryear's standards such as nHibernate, good old custom ORM, or something like LLBGenPro? Also, having run the benchmarks, what are your suggestions? ...

Using C#/WIA version 2.0 on Vista to Scan

I want to implement a paperless filing system and was looking to use WIA with C# for the image acquisition. There are quite a few sample projects on CodeProject, etc. However, after downloading every one of them that I can find, I have run into a problem. In each and every one of them, the reference to WIALib is broken. When I go to add...

C# 2.0 code consuming assemblies compiled with C# 3.0

This should be fine seeing as the CLR hasn't actually changed? The boxes running the C# 2.0 code have had .NET 3.5 rolled out. The background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamically loads assemblies (almost like plug-ins) to complete various work items asked of it. W...

WPF: How to style or disable the default ContextMenu of a TextBox

Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background. I know this works well: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.co...

Using EF Entity as DTO Object

Any opinion about this? ...

Asynchronous Remoting calls

We have a remoting singleton server running in a separate windows service (let's call her RemotingService). The clients of the RemotingService are ASP.NET instances (many many). Currently, the clients remoting call RemotingService and blocks while the RemotingService call is serviced. However, the remoting service is getting complicated...

LINQ query on a DataTable

I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var results = from myRow in myDataTable where results.Field("RowNo") == 1 select results; This is not allowed. Any ideas how to get something like this working? I'm amazed ...

Conditional Linq Queries

We're working on a Log Viewer. The use will have the option to filter by user, severity, etc. In the Sql days I'd add to the query string, but I want to do it with Linq. How can I conditionally add where-clauses? ...

N2 CMS

Hy, does anyone worked with N2 Content Management System(http://www.codeplex.com/n2). If yes, how does it perform, performance wise(under heavy load)? It seems pretty simple and easy to use. Adrian ...

Can I create a ListView with dynamic GroupItemCount?

I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so: region1 store1 store2 store3 region2 store4 region3 store5 store6 Is this possible to do with the ListView's GroupItemTemplate? Every example I have seen uses a stat...