Showing posts with label ASP.NET MVC. Show all posts
Showing posts with label ASP.NET MVC. Show all posts

Wednesday, December 10, 2014

'System.Linq.IQueryable' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'System.Linq.IQueryable' could be found

Error: 'System.Linq.IQueryable' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'System.Linq.IQueryable' could be found

Solution: Add namespace System.Data.Entity; 
Actually Include is not an extension method on Queryable, so it doesn't come with all the usual LINQ methods. 
If you are using Entity Framework, you need to import namespace System.Data.Entity:
Read More

Thursday, November 6, 2014

DbArithmeticExpression arguments must have a numeric common type


DbArithmeticExpression arguments must have a numeric common type Solution: we can't put datediff directly in linq / lambda.. instead of that we should use like : EntityFunctions.DiffMinutes Eg:
              dgvProfiles.DataSource = (from profile in dbModel.ProfileMasters
                                         select new
                                         {
                                             ProfileID = profile.ProfileId,
                                             Profile = profile.ClientName,
                                             Tasks= profile.TaskMasters.Count(),
                                             AverageTime = profile.TaskMasters.Select(x => EntityFunctions.DiffMinutes(x.StartTime, x.EndTime)).Average(y => (decimal?)y.Value),
                                             LastTime = profile.TaskMasters.Max(x=>x.StartTime)
                                         }).ToList();
Read More

Thursday, April 3, 2014

The maximum message size quota for incoming messages (65536) has been exceeded


System.ServiceModel.CommunicationException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. Just increase the MaxReceivedMessageSize if its in client (who is accessing wcf ) then got to app config and change that size like:
Read More

Saturday, March 22, 2014

Prevent addition of default paragraph tag by ckeditor


to prevent addition of default paragraph tag

by ckeditor we have to add below lines in config.js

CKEDITOR.editorConfig = function (config) {
    config.enterMode = CKEDITOR.ENTER_BR;
    config.shiftEnterMode = CKEDITOR.ENTER_BR;
Read More

Thursday, March 13, 2014

HTTP could not register URL . Your process does not have access rights to this namespace


HTTP could not register URL http://+:8080/FileTranfer/.

Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

 The issue is that the URL is being blocked from being created by Windows.

 Steps to fix:
Run command prompt as an administrator.
 Add the URL to the ACL netsh http add urlacl url=http://+:8080/FileTranfer/ user=mylocaluser
Read More

Monday, January 13, 2014

Overwrite Appsetting in ASP.NET MVC

  var config = WebConfigurationManager.OpenWebConfiguration("~");
  config.AppSettings.Settings["appSettingKey"].Value ="Updated value";
  config.Save(ConfigurationSaveMode.Minimal, false);
  ConfigurationManager.RefreshSection("appSettings");

Read More
Powered By Blogger · Designed By Seo Blogger Templates