.net-3.5

Linq-to-entities Include method doesn't load related records.

Hi, I've got 3 tables in my DB: InvoiceDetailLineType, InvoicingCategory, CalculationRule. InvoiceDetailLineType has foreign keys to both InvoicingCategory and CalculationRule. I want to retrieve a list of all InvoiceDetailLineType objects for a given category and include the related CalculationRule and InvoicingCategory objects. Her...

Using LINQ2SQL to insert a large number of records...

We have a small c# tool that we threw together to parse a data file, build up some objects and insert them into the DB. The logic is essentially. string [] lines = File.ReadAllLines("C:\\Temp\\Data.dat") foreach(string line in lines) { MyDataObject obj = ParseObject(line); myDataContext.MyDataObjects.InsertOnSubmit(obj); } my...

How do I pick the best number of threads for hyptherthreading/multicore?

I have some embarrassingly-parallelizable work in a .NET 3.5 console app and I want to take advantage of hyperthreading and multi-core processors. How do I pick the best number of worker threads to utilize either of these the best on an arbitrary system? For example, if it's a dual core I will want 2 threads; quad core I will want 4 th...

HtmlForm.Action and .Net Framework 2.0/3.5 Query

Disappointingly, the members page for HtmlForm 2.0 is missing... My research seems to indicate that HtmlForm.Action is a property that was added in .Net Framework 3.5. However, I'm using VS2005 and my reference to System.Web (the namespace HtmlForm is under) is to a .Net Framework 2.0 runtime version. Further, my IIS status informatio...

RIA Services vs ADO.NET Data Services

I'm currently in the process of creating a Silverlight 3 data driven application. To access the database, 2 common approaches are used: RIA Services and ADO.NET Data Services. Does anyone have any guidance on when/why to choose each approach? Here is what I've gathered from my research / experience. Any thoughts? ADO.NET seems to be...

How can I make the progress bar update fast enough?

I'm using a progress bar to show the user how far along the process is. It has 17 steps, and it can take anywhere from ~5 seconds to two or three minutes depending on the weather (well, database) I had no problem with this in XP, the progress bar went fine, but when testing it in vista I found that it is no longer the case. For example...

How do I embed ads in .NET Compact Framework application?

I'm writing a C# .NET Compact Framework application and would like to embed ads into it (e.g. small banner on top of every screen). However, I couldn't find any advertising SDKs. Aren't there really any? If implementing it from scratch, how would you do it? Google's Ad Sense for example only works with mobile websites (that can be reach...

Entity Framework error - "The EntityContainer name must be unique"

We have a solution which consists of two projects - a console application project and a web application project. Each of these has an identical in schema, but differently named .edmx file used to access the same database. The console application runs as a scheduled task on the same server as the web application is hosted. The web applic...

WPF WebBrowser (3.5 SP1) Always on top - other suggestion to display HTML in WPF

Hello, I've been desperately looking for an easy way to display HTML in a WPF-application. There are some options: 1) use the WPF WebBrowser Control 2) use the Frame Control 3) use a third-party control but, i've ran into the following problems: 1) the WPF WebBrowser Control is not real WPF (it is a Winforms control wrapped in WPF). I ...

How do I use the RichTextBox control?

I want my users to be able to enter text in a Rich Text box and the RTF output be saved to the database. Currently I have the RichTextBox bound to the field in the database, but it strips formatting when it's saved. How can I prevent this? Also, how can I attach a formatting toolbox, (like what's in Wordpad) so my users can change the ...

How to register a .Net service with a command line + parameters?

I would like to be able to pass parameters in the installation of the service. I have modified the C# code of the class that inherit from Installer... My problem is the InstallUtil.exe doesn't work with parameters (well not as I know). Any suggestion? ...

Error after displaying a FolderBrowserDialog

I'm working a backup program and to determine the destination location, I give them the choice to type it in, or browse to it. Lately, I've been getting this error after they browse to it using the FolderBrowserDialog to set the location and the containing form is closed: Managed Debugging Assistant 'DisconnectedContext' has detected a...

TFS Build server - CSC : fatal error CS2008: No inputs specified

We get the above error message on our build server, when we build the solution or the specific project that the error refers to. We can build the solution without any problem using visual studio (also on the build server), however it fails with the above error when running msbuild. Any Ideas? ...

.Net 3.5 CompactFramework Stack

All, I need a high speed stack on a .Net CF platform (ARM chip). Does anyone know if the standard (managed) queue classes work well enough for what I describe below? Anyone got an idea on how fast they are? If I do not used managed memory classes what should I use? The stack will need a maximum size (in megabytes ... 10 or 20 ... so mem...

Is there a widely used library of patterns & interfaces for .NET 3.5?

I'd like to avoid coding my own version of IFactory, ILog, IRepository and other common interfaces & implementations in my projects but find that commonly used libraries containing these tend to be focused on a particular concrete subsystem (one ORM, one IoC container, one logger). I've come across a some that seem more abstract (NCommon...

2.0/3.5 assemblies side-by-side

I have a web application that I expect to intergrate features in assemblies from two separate providers. One set (Set1) of assemblies is build on .NET 2.0 while the other set (Set2) of assemblies ABSOLUTELY requires .NET 3.5. For Set2 assemblies to work, I have to add a (system.codedom) section to web.config and specify the v3.5 compiler...

How can I "Click Through" a control in WPF?

I have an order entry form that has a listbox with a list of line items. I have my items template, and one of the values is a ComboBox in each of my Items. Now, my form can also create Credit memo's in addition to purchase orders, but when I am creating a credit memo, I want to put the words "Credit Memo" over the list box, however, th...

LINQ with generic Predicate constraint

I just upgraded my project to .NET 3.5 and thought I had a perfect use for LINQ. My application has a window manager that tracks open windows at runtime and I'm trying to add a FindOpenWindows generic method. What I've done so far: List<Form> openWindows; public List<T> FindOpenWindows<T>(Predicate<T> constraint) { ...

Unable to get window handle, Windowless ActiveX controls are not supported?

I upgraded my development machine to Windows 7 and my project to .NET 3.5. When I try to run the project, I now get this error: Unable to get the window handle for the 'AxVt' control. Windowless ActiveX controls are not supported. The project is using the Dart Emulation for ActiveX Vt control, which emulates a terminal control. I doub...

TCPListener missing from System.Net.Sockets namespace

I'm using TCPListener which according to this page should be in System.Net.Sockets, I have using System.Net; using System.Net.Sockets; ... TCPListener tcpListener = new TCPListener(10); Visual Studio is producing the following error Error 1 The type or namespace name 'TCPListener' could not be found (are you missing a using di...