Month: February 2016

How to use BETWEEN keyword in LINQ (Eentity-framework)

Posted on

To search between two date ranges in your LINQ for Entity Framework, you can use  Read the rest of this entry »

Working with Input Type=Month in HTML / HTML5

Posted on

To set the value for HTML Input Type=Month provide the value in Year Month combination as: Read the rest of this entry »

The partial view '~/Views/folder/view.cshtml' was not found or no view engine supports the searched locations. The following locations were searched:

Posted on

The partial view ‘~/Views/folder-name/view.cshtml’ was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/folder-name/view.cshtml

The following sections have been defined but have not been rendered for the layout page

Posted on

You usually get this error when you have defined a section in your master layout which may be Layout.cshtml in default scenarios, but you have not included anything for that section in your Views (which are using this master Layout).

If your _Layout.cshtml has something like this: Read the rest of this entry »

EF: Dynamic SQL Problem in Stored Procedure (Entity Framework)

Posted on

If your Stored Procedure is using Dynamic sql as shown in following example, you would probably be getting int as the return type of your EF: Function for this SP

CREATE PROCEDURE [sp_test]
AS
BEGIN
DECLARE @SQL varchar(5000)
SET @SQL =  ' SELECT * FROM TableName';
EXEC (@SQL)

END

Work-Around:

The specified cast from a materialized 'System.Int64' type to the 'System.Int32' type is not valid.

Posted on

We usually get this error when we use Raw SQL in EntityFrameWork, and try to stored returned values in List of your Custom Class. For Example:

[Continued]