Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Thursday, March 19, 2015

[Resolved] Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: playlist in playlists, Duplicate key: string:", Duplicate value: "

Hi today while writing angularjs code using angular directive 'ngRepeat' i came across this below error, to resolve this follow below blog link :

error:

Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: playlist in playlists, Duplicate key: string:", Duplicate value: "


solution :

http://www.anujgakhar.com/2013/06/15/duplicates-in-a-repeater-are-not-allowed-in-angularjs/

Friday, December 5, 2014

[Resolved] Asp.net MVC Error : The controller for path ‘/favicon.ico’ was not found or does not implement IController

hi just came across this below error while debugging a asp.net mvc application.
 The controller for path ‘/favicon.ico’ was not found or does not implement IController
1
. 1. To resolve this go to RouteConfig.cs and write
 routes.IgnoreRoute(“{*favicon}”, new { favicon = @”(.*/)?favicon.ico(/.*)?” });
2
2. Now run the application and check.

Tuesday, August 20, 2013

[Resolved]Msg 8111 Cannot define PRIMARY KEY constraint on nullable column in table 'tablename' | SQL Server Add Primary key constraint to table

To Resolve such an error :

Msg 8111
Cannot define PRIMARY KEY constraint on nullable column in table 'tablename'.
Msg 1750
Could not create constraint. See previous errors.

Steps:

1. First Remove all the null values from the column on which primary key has to be created or update such fields with unique values.

2.Then Make that column as not Nullable using this query:

ALTER TABLE tablename ALTER COLUMN columnName NOT NULL

3. Now We can add the primary key constraint for the table.

ALTER TABLE tablename 
ADD CONSTRAINT PK primary key (columnName

Monday, August 12, 2013

[Resolved] Asp.net Http Runtime maxRequestLength exceeded error

hi maxRequestLength  exceeded error can be resolved as below :

Such an error occur when the uploaded data exceeds the limit. Like if the limit is 4MB and file begin uploaded to the server is 5 MB then such an error will occur.

By default the Http Runtime maxRequestLength  is 4MB we can increase this size in the web.config file of the application.

Suppose we want to increase the limit to 8MB then in the web.config file do the following :

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="8192" />
    </system.web>
</configuration>


MaxRequestLength Accept values as KiloBytes.

Tuesday, August 6, 2013

[Resolved]The XML parse error near XML text | Msg 6602 Procedure sp_xml_preparedocument, Line 1 The error description is 'Whitespace is not allowed at this location.' | Msg 8179 Could not find prepared statement with handle 0.

hi in this post i show how to resolve the error generated while XML Parsing in SQL.

Example :

DECLARE @INDEX INT
DECLARE @XMLEMPLOYEE NVARCHAR(MAX)

SET @XMLEMPLOYEE = N'<ROOT><EMPLOYEE EMPID="1" EMPNAME="CHANDAN"/>
                            <EMPLOYEE EMPID="2" EMPNAME="CHANDAN & SINGH"/> 
                     </ROOT>'

EXEC SP_XML_PREPAREDOCUMENT @INDEX OUTPUT
 ,@XMLEMPLOYEE

SELECT EMPID
 ,EMPNAME
FROM OPENXML(@INDEX, 'ROOT/EMPLOYEE') WITH (
  EMPID NVARCHAR(50)
  ,EMPNAME NVARCHAR(550)
  )


After Executing this above query, we get the error as below:

The XML parse error 0xc00ce513 occurred on line number 2, near the XML text "<EMPLOYEE EMPID="2" EMPNAME="CHANDAN & SINGH"/>".
Msg 6602, Level 16, State 2, Procedure sp_xml_preparedocument, Line 1
The error description is 'Whitespace is not allowed at this location.'.
Msg 8179, Level 16, State 5, Line 9
Could not find prepared statement with handle 0.


The problem is due to the using of ampersand(&) in the xml document.

Solution:

While creating the XML document replace the ampersand(&) with &amp; and then re-run the query to get the correct output.

DECLARE @INDEX INT
DECLARE @XMLEMPLOYEE NVARCHAR(MAX)

SET @XMLEMPLOYEE = N'<ROOT><EMPLOYEE EMPID="1" EMPNAME="CHANDAN"/>
                            <EMPLOYEE EMPID="2" EMPNAME="CHANDAN &amp; SINGH"/> 
                     </ROOT>'

EXEC SP_XML_PREPAREDOCUMENT @INDEX OUTPUT
 ,@XMLEMPLOYEE

SELECT EMPID
 ,EMPNAME
FROM OPENXML(@INDEX, 'ROOT/EMPLOYEE') WITH (
  EMPID NVARCHAR(50)
  ,EMPNAME NVARCHAR(550)
  )


It will give the ouput as :

EMPID EMPNAME
1 CHANDAN
2 CHANDAN & SINGH

Monday, July 8, 2013

[Resolved] ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified..Column '' cannot be added to non-empty table '' because it does not satisfy these conditions. | Msg 4901, Level 16, State 1 | SQL alter table error

Hi in this post i will show how to resolve this below error.

Msg 4901, Level 16, State 1, Line 1
ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column '' cannot be added to non-empty table '' because it does not satisfy these conditions.


1. Creating a scenario where you can get this type of issues.

create table empDetails
(
nameid int identity primary key,
name varchar(1000),
addres varchar(1000),
mobile numeric
)

insert into empDetails(name,addres,mobile) values ('chandan','india',123456789)

select * from empdetails



2. Now i will add a column to this table  

alter table empdetails
add [deptid] [int] NOT NULL 

Executing this wil give me the error as

To resolve this we will add default value '0' to the column.


Thus the error gets resolved.