Latest Posts
Showing posts with label Errors. Show all posts
Showing posts with label Errors. Show all posts
Thursday, November 11, 2021
JavaScript error handling is a lot like other languages where you have the try/catch/finally statement that you can used. The basic premise is
try
{
// try some codes here fingers crossed that nothing bad happens
}
catch(ex)
{
// oops something bad happened, this is where it gets handled or I tell the user
}
finally
{
// I don't care what happens I am going to execute and get paid
}
Here is the error handling in action:
try
{
// try some codes here fingers crossed that nothing bad happens
}
catch(ex)
{
// oops something bad happened, this is where it gets handled or I tell the user
}
finally
{
// I don't care what happens I am going to execute and get paid
}
Here is the error handling in action:
Thursday, October 21, 2021
There are times when you will get an error when you tried to access a property in an object, sometimes you think a property exists in the object but it does not. Let's use the product object from the previous blog post as an example.
Let's say another developer works on the project and he assumes that since there's a "country" property that there should be a "city" property. If he tries to access the access the "city" property in the product object he will get an undefined, because the property does not exist. If he types the following he will get the undefined message.
var product = new Object(); product.name = "Chai"; product.category = "Tea"; product.country = "India"; product.supplier = { name: "ACME Tea Of India", location: "New Delhi" };
Let's say another developer works on the project and he assumes that since there's a "country" property that there should be a "city" property. If he tries to access the access the "city" property in the product object he will get an undefined, because the property does not exist. If he types the following he will get the undefined message.
Thursday, June 24, 2021
SQL GROUPING allows you to segregate data into groups so that you can work on it separately from the rest of the table records. Let's say you want to get the number of products in a category in the Northwind database Products table.
You would write the following query:
The query above gives you the following results:

SELECT COUNT(*) NumberOfProductsByCategory FROM Products GROUP BY CategoryID
The query above gives you the following results:

Friday, July 26, 2019
In the previous post we have enabled MVC on our application. Now we want to add our first MVC controller and view to test out verify that MVC is working. We also have to tell ASP.NET Core what pattern to look for when looking for our controllers and views.
Wednesday, August 8, 2018
An ASP.NET MVC can get big, and it could be overwhelming. Areas are a way to break up the application into smaller segments, A perfect candidate for an Area is the Administrative features of the site because it has multiple pages, and functionalities. So it is a good idea to segment off the Administration area to its own area (no pun intended).
Wednesday, March 29, 2017
Logging is a good service to add as the application gets more complicated. It will allow us to see what the error is when things goes wrong.
To add logging to our ASP.NET Core application follow the steps below:
1. Open the Startup.cs file and add the logging service to the ConfigureServices method with the line
services.AddLogging();
So your ConfigureServices method should look like the following
To add logging to our ASP.NET Core application follow the steps below:
1. Open the Startup.cs file and add the logging service to the ConfigureServices method with the line
services.AddLogging();
So your ConfigureServices method should look like the following
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); var connectionString = Startup.Configuration["Data:NorthwindContextConnection"]; services.AddDbContext(options => options.UseSqlServer(connectionString)); services.AddLogging(); }
Thursday, March 16, 2017
In the previous blog post we created a configuration file for our MongoDB database in this post we will install MongoDB as a Windows service so that we don't have to start the service in the command line every time we want to use it to save development time.
Here are the steps to install MongoDB:
1. Open the command prompt as an "Administrator"
2. Change the mongo-db-config.conf file to use absolute paths. You can get the instructions on how to create a MongoDB configuration file in this blog post
dbpath = C:\techjunkie\mongodb\db
logpath = C:\techjunkie\mongodb\mongo-db-server.log
verbose = vvvvv
if the folder dpath folder does not exists in Windows create the folder "db" inside the "mongodb" folder, else the service start will fail
Here are the steps to install MongoDB:
1. Open the command prompt as an "Administrator"
2. Change the mongo-db-config.conf file to use absolute paths. You can get the instructions on how to create a MongoDB configuration file in this blog post
dbpath = C:\techjunkie\mongodb\db
logpath = C:\techjunkie\mongodb\mongo-db-server.log
verbose = vvvvv
if the folder dpath folder does not exists in Windows create the folder "db" inside the "mongodb" folder, else the service start will fail
Saturday, June 18, 2016
A lot of people think that you can only create one kind of ASP.NET MVC project, the one with the sample application. But the reality is that you can create an Empty ASP.NET MVC, you just need to do more work. However, it is cleaner and you can add what you need, instead of having everything in place already like the default template. So you might run into more errors with the empty project, but I think you will learn more about MVC than if you just have the default template. Plus it's more streamline. I always start with an empty project on my MVC projects. In order to follow this tutorial you must have Visual Studio 2017 installed.
Monday, March 23, 2015
In the previous blog we went over how to create a simple ASP.NET MVC 4 application. In this blog we will go over the steps to upgrade our ASP.NET MVC 4 application to ASP.NET MVC 5 application.
Step-By-Step Instructions:
Step-By-Step Instructions:
- Open the "MyMVC4" project that you've created on the last blog
- Right click on the project and select "Manage NuGet Packages..."
Monday, March 9, 2015
Transaction processing is a concept in SQL that allows you to execute a query or rollback the changes if something goes wrong. A way of enforcing the data integrity of the database. As such, you can only rollback INSERT, UPDATE, and DELETE. Not that there's any use in rolling back a SELECT statement because there's no change in data.
The following is how you would wrap a transaction around a DELETE statement:
(1 row(s) affected)
If you are dealing with multiple statements then you can use the SAVE TRANSACTION, SAVE TRANSACTION allows you to create a placeholder so that you can rollback a transaction at a checkpoint.
The following is how you would wrap a transaction around a DELETE statement:
BEGIN TRANSACTION DELETE Products WHERE ProductID = 87 COMMIT TRANSACTIONThe above query will only execute if there are no errors, if there's an error the transaction will be rolled back. That's it, that's the whole concept of what a transaction is, if there are no errors then you should get the following message.
(1 row(s) affected)
If you are dealing with multiple statements then you can use the SAVE TRANSACTION, SAVE TRANSACTION allows you to create a placeholder so that you can rollback a transaction at a checkpoint.
Friday, July 25, 2014
The DELETE statement conflicted with the REFERENCE constraint "FK_Order_Details_Products". The conflict occurred in database "Northwind", table "dbo.Order Details", column 'ProductID'.
The statement has been terminated.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_Order_Details_Products". The conflict occurred in database "Northwind", table "dbo.Order Details", column 'ProductID'.
The statement has been terminated.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_Order_Details_Products". The conflict occurred in database "Northwind", table "dbo.Order Details", column 'ProductID'.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1789294
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5340642
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1691
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +275
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +1421
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +208
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +163
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +378
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +568
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +84
System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +930
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +974
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +201
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9703566
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009
Tuesday, October 8, 2013
If you receive the WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery' error, put the following lines of code in the Appliction_Start method in the Global.asax.cs file
The above lines of code registers the jQuery library with the ScripManager. This will get rid of the error, you can do the same this with jQueryUI library.
protected void Application_Start(object sender, EventArgs e) { string jqueryVersion = "1.8.0"; System.Web.UI.ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new System.Web.UI.ScriptResourceDefinition { Path = "~/Scripts/jquery-" + jqueryVersion + ".min.js", DebugPath = "~/Scripts/jquery-" + jqueryVersion + ".js", CdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery" + jqueryVersion + ".min.js", CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery" + jqueryVersion + ".js", CdnSupportsSecureConnection = true, LoadSuccessExpression = "Window.jquery" }); }
The above lines of code registers the jQuery library with the ScripManager. This will get rid of the error, you can do the same this with jQueryUI library.
Subscribe to:
Posts (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu