.net-3.5

How do I determine which monitor my winform is in?

I have been up and down this site and found a lot of info on the Screen class and how to count the number of monitors and such but how do I determine which montitor a form is currently in? ...

Using .NET Framework 3.5 in a SQL Server 2005 Stored Procedure

I have an SQL Server 2005 server, and I'd like to run a .Net CLR stored procedure on it. However, I'd like to use .NET Framework 3.5. If I try this right now, I get this error: Error: Assembly 'system.core, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' was not found in the SQL catalog. I'm told this is possible ...

How to Instantiate User control in Master page cs file

I have added uc in contentplace holder of master page but how do you instantiate the user control in master page .cs file to make it visible when the master page loads ...

SOAP Attachment from .NET 3.5 to PHP web service

We've got a PHP web service which we need to send a file from a .NET 3.5 web app. The PHP team has stated that we need to provide the file in the form of a SOAP attachment, but we can't find a way from which we can do that in .NET. All reference examples that we've been able to come across refer to using the DIME, but that's not suppor...

WPF CommandParameter is NULL first time CanExecute is called

I have run into an issue with WPF and Commands that are bound to a Button inside the DataTemplate of an ItemsControl. The scenario is quite straight forward. The ItemsControl is bound to a list of objects, and I want to be able to remove each object in the list by clicking a Button. The Button executes a Command, and the Command takes ca...

Can You Determine Timezone from Request Variables?

Is there a way to do your timezone offsets on the server side, by reading something in the request over http, instead of sending everything to the client and letting it deal with it? ...

What is special about HashSet<T> in .NET 3.5?

Here's an interesting puzzle. I downloaded Snippet Compiler to try some stuff out, and wanted to write the following code: using System; using System.Collections.Generic; public class MyClass { public static void RunSnippet() { HashSet<int> h = new HashSet<int>(); } } But the above code doesn't compile. I get: "...

ASP.NET session - How can I tell if a session is new due to expiration or initial visit?

We have a page of search results which the user can hit in several ways. 90% of the ways will set up a 'Search Criteria' session object, which the results page will use to retrieve the search results. When the session object isn't found, we will typically show the user an 'invalid search' message, and give them a link to the main searc...

Should any domain object, not be serializable?

Is there a way to just tell the compiler, that I want my objects to be serializable by default? ...

C# to VB.Net: Why does this fail to compile when converted to VB?

I have this C# extension method that will extend any dictionary where the Value type is an IList. When I write the equivalent code in VB.Net I get the following compile error: "Extension method 'Add' has some type constraints that can never be satisfied". I find this really puzzling as the same type constraints can be satisfied in...

Long to short pathnames without p/invoke

Does anyone know how to convert long to short pathnames in .net 3.5 without p/invoke? I can do it with p/invoke if I have to, but I'd rather not. ...

MS MVC Preview 2 and .NET 3.5 sp1

I have a site built with MVC Preview 2 and have not got around to upgrading to latest release, mainly because of the number of changes required and I have not had time. Anyway, last night my host installed .NET 3.5 sp1 and it killed my site. It is an identified problem (thats what you get for using pre betas) on this site http://haacked....

System.EngineExecutionException on a return from a WCF service

This one has us all baffled at work. We have two services running on .net 3.5 SP1 that hits up sharepoint, and return Lists of model objects that are pretty similar. One of them works fine, the other throws an EngineExecutionException on the return. I know that is sort of vague, but everything executes fine right up until that point. Wh...

How do I Get the Autcomplete Control script side with a Script control (ASP.Net)

Problem How do I capture and assign the events on an Ajax Toolkit autoomplete control using a script control on the script file? Explanation I basically created a script control to combine a textbox and an autocoplete control so that I could have a working generic control for an autocomplete. The next step was to add things like a pro...

DataContractSerializer: Handling objects whose type you don't know and don't have access to.

I have a class (call it Container) which is serialized and deserialized using the DataContractSerializer. The class contains a collection of other classes, all of which inherit the same base class (call it ContentsBase), but which have distinct derived classes. The application may be passed a serialized Container object which contains Co...

Memcached with Windows and .NET

Is there anyone already implement memcached for production use in Windows environment? Because many blogs that I've read, it's not recommended to run memcached in Windows especially for production use, for example running memcached on windows. And one more thing, which memcached client that is good to use with c# and .net 3.5 ? I've fou...

Could not find default endpoint element

I've added a proxy to a webservice to a VS2008/.NET 3.5 solution. When constructing the client .NET throws this error: Could not find default endpoint element that references contract 'IMySOAPWebService' in the service model client configuaration section. This might be because no configuaration file was found for your app...

Hierarchical data binding with nested ListViews in WPF

I have some data that has a detail table. I want the data to be presented in a ListView. I want the detail data to appear as a nested ListView when you select an item in the original list. I can't seem to figure out how to get the data binding to work. Here's what I have so far, (the problem is the {Binding Path=FK_History_HistoryItems}...

Where does the file Microsoft.CompactFramework.VisualBasic.targets come from?

I have a Pocket PC 2003 solution, consisting of three projects, that was created in Visual Studio 2005. I open the solution in Visual Studio 2008 and two of the projects fail to convert due to errors like the following: Unable to read the project file 'PDA.vbproj'. D:\PDA.vbproj(121,61): The imported project "C:\WINDOWS\Microsoft.NET\F...

Converting A Dataset to JSON using .net 3.5 in C#

Hi All... I have been searching for a simple way to convert a dataset from a postgres database to JSON for use in a project that i am building. This is my first time using JSON and I have found it really tricky to find a simple way of doing this. I have been using a stringbuilder at the moment to create a JSON string from the informatio...