Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



HtmlAgilityPack Input string was not in a correct format HtmlAgilityPack.HtmlDocument.DocumentNode.SelectNodes

Home    ASP .NET    Error    HtmlAgilityPack Input String Error

       


ASP .NET Error : 
Input string was not in a correct format.
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.FormatException: Input string was not in a correct format.

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.

This error happens when u give a string for an index value 

This is where error happened in my code
Doc.DocumentNode.SelectNodes("//meta")("Keywords").Attributes("content").Value = txtMetaKeyword.Text

This is how I corrected it 
Doc.DocumentNode.SelectNodes("//meta")(0).Attributes("content").Value = txtMetaKeyword.Text

The error was index doesnot accept string "Keywords" you have to give a numeric value 0





  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

Copyright 2009 @ Murugan Andezuthu Dharmaratnam