June 2011 - Digital Tool Factory blog June 2011 - Digital Tool Factory blog

The Digital Tool Factory Blog

How to fix problems with Linq and the Entity Framework

database 2

The Problem:

You attempt to do a query using Linq To Entities and your code does not work.

The Cause:

For reasons unknown, Linq to Entities has different operators than Linq To Sql.

The Solution:

Call your initial query/pull and us .ToList() on it before you run any of the problem operators – this fixes the problem entirely.
I am embarrassed to say that I spent 30 minutes trying to get Linq to Entities to work directly before I thought of that.

Creative Commons License photo credit: Tim Morgan

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


24
Jun 11


Written By Steve French

 

How to fix problems uploading images in asp.net mvc 3/razor

The Problem: You are attempting to create create an asp.net mvc 3 page with razor that uses an upload control.  You try to upload an image and all you get is a “server not available” error.  Not very descriptive it it?

The Cause: ASP.net sets the default upload limit very low.

The Solution: Raise the limit, just add this to the web.config file ,

<httpRuntime maxRequestLength=”9097151″ executionTimeout=”3600″/>

That’s it!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


13
Jun 11


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.