Are you getting this? System.InvalidOperationException The null value cannot be assigned to a member with type System.Int64 which is a non-nullable value type. On something like this? var totalSize = query.Sum(x => x.Size); This occurs because your LINQ property (in my case “Size”) is not nullable, and needs to be nullable because your Sum() operation [...]
Also filed in
|
Tagged C#, linq
|
Hey gang, just a quickie today. I have been working recently on setting up server side and client side model validation “by the book” in ASP.NET MVC 2 complete with data annotations and the first question that hit me when I was declaring attributes on my LINQ to SQL partial classes to determine model validation [...]
Just heard news of a sweet new website dedicated to Theming and Styling Visual Studio, called “StudioStyles” now that’s my kinda site. Go check it out, tons of themes to choose from if your VS IDE is looking kinda drab or you’re sick of looking at that same old blue and white… I also just [...]
If you would like to see the contents of your WCF message body packet as understood by the server, you can enable WCF message logging via a few adjustments in your WCF Service Web.config file and by then by using the Microsoft Service Trace Viewer application to view it. I found best results by creating [...]
Also filed in
|
Tagged wcf
|
Every now and then I find myself needing to set multiple values to an enum object and test this later on, synonymously I usually find myself also scouring the net on the best practice on how to set, access and test these enum flags So today I thought I would post a definitive reference I [...]
Also filed in
|
Tagged C#
|
As you may be aware, setting up a TCP-based full duplex WCF service can have some pretty awesome advantages over regular HTTP-based WCF services, such as the ability for a true client/server persistent connection and the ability for the server to call back to the client at any time and there are a few good [...]
Also filed in
|
Tagged was, wcf
|
Howdy everyone, firstly I would like to apologise for the lack of blog updates, I have seriously been flat out on development with our new online start-up, Fotochimp and have not had much time for blogging. However today I am taking a few minutes time-out to share some links with you I found for a [...]
It appears the new IntelliTrace feature of Visual Studio 2010 is only available for x86 applications?! Don’t ask me, there is an article with more info, but Habib Heydarian shed some light on the workaround here. It appears to get around this problem, you must set your project to a configuration platform of x86, enabling [...]
If you are fed up with continually having to press “Attach” to attach to the IIS w3wp.exe to enable debugging in Visual Studio for IIS as seen in this screenshot: Then never fear, this is a way around it. All you need to do is adjust the registry setting (via regedit.exe) as Visual Studio wasn’t [...]
You may receive an error: Running transformation: Microsoft.SqlServer.Management.Smo.FailedOperationException: SetParent failed for Database ‘XXXX’. —> Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server XXXX. —> Microsoft.SqlServer.Management.Common.ConnectionFailureException: This SQL Server version (10.0) is not supported. When attempting to connect to a SQL Server 2008 database when working with T4 templates or simply accessing an SQL Server directly using the [...]