|
|
Browse by Tags
All Tags » C# 2.0
Showing page 1 of 2 (11 total posts)
-
For those who like me didn’t know about this hidden gem:
You can now set Tracepoints instead of just Breakpoints in VS2008. Here’s the difference between the two as described on MSDN:
“Breakpoints tell the debugger that an application should break, pause execution, at a certain point. When a break occurs, your program and the ...
-
Just came across a nasty gotcha today, where by we were trying to use the new C# 3.5 syntax
var x = from item in items select new Item { ItemName = item.Name };
and getting a compile error. Turns out this was due to the need to have the following using statement (that doesn't come up in a smart tag prompt when you're writing linq),
using ...
-
WCF System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedlyIf you get the above error when trying to return large numbers of items in a List<T> from a WCF service, then ensure you have set the following behaviour for the dataContractSerializer in both your client and service configuration ...
-
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /DesignMode /u /ShowCallStack /Configuration="C:\Data\Merrick\Projects\Data Access Guidance Package\Data Access Guidance Package\Data Access Guidance Package\bin\Debug\\Data Access Guidance Package.xml" "C:\Data\Merrick\Projects\Data Access Guidance Package\Data Access ...
-
A colleague of mine recently asked for how to create a one liner to iterate over the items in a list. In C# 2.0 this is best done using the System.Action<T> delegate ForEach method, as it reduces the lines of code that you would normally write.
Easy way to think of it, is to write the foreach loop in the normal way, then change the foreach ...
-
Recently I posted an article and some code for a service which logs onto MSN Messenger and exposes some web services for sending messages. I promised in that article that if I got time to refactor the code to use WCF I would post it - here it is and the code is quite a lot simpler. The revised code is attached to this blog post, you ...
-
Some time ago I posted a question about reflection on generics. This remained unanswered until Anthony recently posted the solution in a comment. To reiterate what was said in there:
The Question
I have a generic interface ICustomDataMapper<T>. I want to know, programatically, if a Type t which has been ...
-
Recently I needed to send a custom collection class as a response to a WCF call. I duly added the normal [DataContract] attribute and was rewarded with the following WCF error:Type 'MyCollection' is an invalid collection type since it has DataContractAttribute attribute.Hang on, you may think, why do we needed custom collection ...
-
Check out the flex wiki site below. Has C# code examples for most if not all of the Windows API. Really useful for Windows programming.
www.pinvoke.net
-
I was writing a SQLCLR C# stored proc and wanted to return some results which were held in a DataTable. Inconveniently, there is no built-in way of translating from System.Data class to Microsoft.SqlServer.Server classes. So I wrote something which does just that, and here it is.private static void SendDataTableOverPipe(DataTable ...
1
|
|
|