Posts

Donate

Entity Framework - Store update, insert, or delete statement affected an unexpected number of rows (0)

As I was creating a simple Create, Update, Delete (CRUD) application in ASP.NET MVC 5 and executing the controller on Edit, I encountered an error called "Store update, insert, or delete statement affected an unexpected number of rows (0)". After debugging and looking at the stack trace, I found out that the value of the primary key is zero. Department: "Education" Designation: "Dean" EmployeeName: "JE" EmployeeID: 0 Salary: 25500 The fix for this issue is to add a hidden field to the edit view referencing to the primary key which in this case is the EmployeeID. @Html.HiddenFor(model => model.EmployeeID) And now, the model passed to the context now has a value for the EmployeeID field. Department: "Education" Designation: "Dean" EmployeeName: "JE" EmployeeID: 2 Salary: 25500 Cheers! :)

How To Reset Cascading Dropdown Controls Using JavaScript And jQuery

Hi, Recently, I have encountered an issue on how to reset cascading dropdown controls in cross browsing mode (IE/Firefox/Chrome) using JavaScript and jQuery. After creating code spikes, I come up with a solution that works across major browsers. Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 $( ".reset-link" ).click( function () { ResetCascade($( this )); }); function ResetCascade(itemReset) { var formID = $(itemReset).closest( '.contact-form' ); if (formID != null ) { var firstDropDown = $(formID).find( '.cascading_group' ).find( '.firstDropDownDiv select' ); var secondDropDown = $(formID).find( '.cascading_group' ).find( '.secondDropDownDiv select' ); var thirdDropDown = $(formID).find( '.cascading_group' ).find( '.thirdDropDownDiv select' ); if (firstDropDown != null ) { var valueId = $(firstD

The type or namespace name 'LineShape' does not exist in the namespace 'Microsoft.VisualBasic.PowerPacks' (are you missing an assembly reference?)

Image
Good day! After migrating and then rebuilding the solution of a Windows Forms application from Windows XP machine to Windows 8, I encountered an error as stated on the title of this post. I suspect this has something to do with the old version from the XP machine not recognized on the new machine. The steps to fix this issue are provided below: 1. Download Microsoft Visual Basic Power Packs 3.0 here: Microsoft Visual Basic Power Packs 3.0 2. Remove the previous Microsoft Visual Basic Power Packs under References in your project 3. Add the MS Power Pack version 3.0 as reference to your project from the default installation folder located here: C:\Program Files (x86)\Microsoft Visual Basic 2005 Power Packs\3.0 4. Rebuild your project. Greg Esguerra:)

There is a duplicate scriptResourceHandler section defined (HTTP Error 500.19)

Image
Good evening! The solution I found so far for this issue "There is a duplicate scriptResourceHandler section defined (HTTP Error 500.19)" was to change the Application Pool of the website from DefaultAppPool to .NET v2.0. I also have tried with no luck other solutions based from stackoverflow. Issue Fix Details Operating System: Windows 8 IIS: Version 8 Default Site Framework: .NET 3.5 SP1 Reference: There is a duplicate scriptResourceHandler section defined

Visual Studio And .NET Framework - The installer was interrupted before Application could be installed

Image
I have an .msi file created using .NET Framework 3.5 SP1 in which it can't proceed to installation as stated by the title of this post. Since I'm running on IIS 8, there might be some issues communicating with IIS 6. Taken from the point that this application was packaged using Visual Studio 2008. The fix is to enable IIS Metabase and IIS 6 configuration compatibility through the Control Panel -> Turn Features On/Off. Details OS: Windows 8 IIS: 8 .NET Framework: 3.5 SPI Visual Studio: 2008

Run MSI file as Administrator in Windows 8

Hello, Right clicking an MSI file through Windows 8 and then "Run As Administrator" isn't supported. After doing some research, I found some steps to achieve it. See instructions below: 1. Start Button / key 2. Type in "cmd" without quotes and press Shift+Enter to open a command prompt as an administrator. 3. Type in the full path to the msi and press enter. Put the path inside quotes if it has any spaces like "C:\Users\username\My Documents\SoftwarePackage.msi" 4. Press enter and agree to execute the MSI See Reference here: Run an MSI file as Administrator

Unity already has a dependency defined for CommonServiceLocator (VS 2012 Ultimate)

Image
Hello, While trying to add Unity to a Console Project, I encountered an error as stated by the title of this post. After doing some research, I found a post in Stack Overflow which is to update Nuget Package Manager. When I checked my VS, the nuget package manager is an older version. So, I removed/uninstalled it and added the recent version of Nuget package manager through Tools -> Exentsion and Updates then look for Nuget Package Manager. Then install/download it in your VS IDE. See image for current Nuget Package Manager. That's It.. :)

How To Set Transparent Border Color In Internet Explorer 8 And Below Using CSS

Good evening! Normally, the css snippet below paints a transparent border to containers or divs using Mozilla Firefox, Chrome or IE9+. .NewsContent { background-color : #fff; border : 10px solid transparent ; background - clip : content -box; } However, for other IE8 and below, I had a hard time figuring out how to make the border transparent. Luckily, I found a link: Border Color Transparent in IE6 which serves as the basis on how to set transparent border color in Internet Explorer 8 and below using CSS below: .NewsContent { background-color : #fff; border : 10px solid black; filter: chroma( color =black); } Afterwards, the border color changed to transparent. MSDN link: MSDN Chroma Filter :)

Access Is Denied (User.Identity.Name) In ASP.NET MVC

Image
Hi, Given you have an ASP.NET MVC code below that will show the current user logged in a domain: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <div class= "content-wrapper" > <div class= "float-left" > <p class= "site-title" >@Html.ActionLink("your logo here", "Index", "Home")</p> </div> <div class= "float-right" > <section id= "login" > Hello, <span class= "username" >@User.Identity.Name</span>! </section> <nav> <ul id= "menu" > <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home"

Ajax Calls Not Working In Internet Explorer 8

After testing the external js files in IE 8, the calls to post data to a controller does not work. After googling, I found a fix that is to set true to jquery support cors. jQuery Code: 1 jQuery.support.cors = true ; CORS, INTERNET EXPLORER 8, AND XDOMAINREQUEST Cheers!

Donate