Solution select ID, Category from t_Con_ChargesAmount where ID in (Select max(ID) FROM t_Con_ChargesAmount group by Category) Explanation This query will select ID and Category from the table and the Category will be distinct now.
System.Data.Entity.Core.EntityCommandExecutionException
Solution This error occurs when for example, there is a mismatch e.g. in a model or database column name. Ensure that the names of the parameters given in C# (where the call to procedure is given) match with those in the procedure(in database)
There is no ViewData item of type ‘IEnumerable’ that has the key ‘DropDownList’.
Solution In Controller ViewData["DropDownList"] = clsChargesCollection.FillInstallments().Select(x => new SelectListItem { Text = x.Description, Value = x.ID.ToString() }).ToList(); Syntax ViewData["name to be given"]=db.MethodName.Select(object => new SelectListItem{Text = object.columnName, Value = object.columnName.ToString()}.ToList(); In View: Try to access the variable within the top of your View where titles are given @{ List <SelectListItem> MemIds = ViewData["DropDownlist"] as List<SelectListItem>;... Continue Reading →
System.Web.HttpException: The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”.
Solution The exception occurs if you have defined a section in your master Layout.cshtml, but you have not included anything for that section in your View. If your _Layout.cshtml has something like this: @RenderSection("scripts") Then all your Views that use that Layout must include a @section with the same name (even if the contents of the section are... Continue Reading →
Metadata file dll could not be found
Solution If there is no such file on the path that is mentioned in the error, then it is just because the build of the problematic project is failed. Just comment all the lines of code that are causing error(s) and build the project again. The error will be gone.
Class is inaccessible due to its protection level
Cause As it already states that class is inaccessible due to its protection level, it means that the protection level of the constructor or class is not public due to which it cannot be accessed by any other class. Therefore, you need to make it public so it can be accessed by other classes. Sometimes... Continue Reading →
The Journey Begins!
Thanks for joining us! Bug Fixes and Coding Solutions is a dedicated platform to fix bugs in your code and provide easy coding solutions to the problems you face daily while programming.Coding Bugs refer to errors and exceptions you encounter while programming. Coding solutions are not limited to solutions to Bug fixes but it also... Continue Reading →