.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

IIS 5.1 '.', hexadecimal value 0x00, is an invalid character

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net


I have a  web page which calls some XML from a web service.  The code works fine on my production server (IIS 7) but I get the below error on my Development machine Win XP, IIS 5.1

'.', hexadecimal value 0x00, is an invalid character

Any ideas why I am getting this error when on IIS 5.1

Many thanks in advance


View Complete Post

More Related Resource Links

XML Task error message hexadecimal invalid character

I am developing a SSIS package to add data from an XML file to an existing SQL Server table.  I have completed several similar projects, but on this XML file I am getting the error from the Data Flow tab between the XML Task and Data Flow Task: Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message: "'', hexadecimal value 0x15, is an invalid character. Line 28, position 54.". Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text; Xml Text is either invalid, null or empty string. Task failed: XML Task Warning: 0x80019002 at zSTU_TS_Element: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "zStu_TS_Element.dtsx" finished: Failure. Do you know how I can fix this? This is the line it is referring to: <z:row c0='12' c1='80' c2='2006-04-17' c3='539' c4='1M2083N4N5N6N75800901110 11 '/>

XmlWriter.WriteRaw - hexadecimal value 0x1F, is an invalid character.

Using VS 2008, .Net 3.5, C#. In creating an XML string, I need to embed some non-printing ASCII characters such as 0x1C, 0x1D, 0x1E and 0x1F. However, when writing them using the WriteRaw function, I get the error message "hexadecimal value 0x1F, is an invalid character". In checking XML specifications, all the characters I am using are valid in XML. The xml declaration in the string is "<?xml version="1.0" encoding="utf-16"?>" Thanks in advance for any guidance.  

(On SELECT) Hexadecimal value 0x19 is an invalid character


Hi everyone,

I'm using SQL Server 2008 Management Studio and trying to select from a sql table that has an invalid XML character in it.


If I just try to select * from the table I get:

An error occurred while executing batch. Error message is: '(square box)', hexadecimal value 0x19, is an invalid character.

I've tried to run a select replace(DataXML, char(25), '') from the table as suggested in this thread:



and I get the error message:

Argument data type xml is invalid for argument 1 of replace function.


Converting the column type in the table doesn't work. Cast doesn't work. Everything I've tried gives an error.

I just want to get rid of the invalid character and take a look at what's inside the XML so I can try to prevent this from happening again.


Anyone have any ideas?

Cannot FindByThumbprint - Invalid Hexadecimal string format

I'm trying to set up a sample WCF service using a self-signed certificate.  For some reason, I repeatedly get the error "FormatException - Invalid hexadecimal string format." I was initially trying it in the config file but decided to try setting it up in code but still get the same error. I then tried it on a different machine and it works just fine.  I would appreciate any suggestions.  Here are the details. Environment:  Windows 7 Home Premium, Visual Studio 2010 C# Express Edition, .NET 4.0 Code:     // Create the host ServiceHost host = new ServiceHost(hostType);     string valueToFind = "‎‎‎‎‎66 31 bf 9e f7 4f 9e b6 c9 d5 a6 0c ba 6a be d1 f7 bd ef 7b"; host.Credentials.ServiceCertificate.SetCertificate(   StoreLocation.CurrentUser, StoreName.Root, X509FindType.FindByThumbprint, valueToFind);     The exact same code runs just fine on another machine.  No complaints of an invalid hexadecimal value.  Here are the details of the other machine: Environment:  Windows XP, Visual Studio 2010 C# Premium, .NET 4.0 Any ideas?

How do I escape invalid xml character 0x02?

In one of my tables an end user managed to insert a character 0x02 into a varchar(255) column. At some point in time, from this table xml documents are generated using the for xml path() syntax. For the record with the 0x02 character in it this now generates an error:

".Net SqlClient Data Provider: Msg 6841, Level 16, State 1, Line 22
FOR XML could not serialize the data for node 'v' because it contains a character (0x0002) which is not allowed in XML. To retrieve this data using FOR XML, convert it to binary, varbinary or image data type and use the BINARY BASE64 directive."

I've now  hit this error on char(2), but the same error occurs for a lot more characters.

The example below illustrates this by inserting 2 records in a table and creating an xml document for both records. The record with id = 1 is no problem, a valid xml is generated; even the '&' in it is properly escaped in the xml and translated back into a '&' when I retrieve the varchar value for the element. The record with id = 2 can however not be generated into an xml document.

I would expect an escape sequence like '&#02;' to be generated for the char(2) character, analogous like the '&' is escaped as '&amp;'.

Web service's method GetListItems fails with error "'_', hexadecimal value 0x0B, is an invalid ch


We are developing ASP.NET web application that interacts with SharePoint via web services. At some our customers' systems we encountered the following problem.
Web method GetListItems throws an exception :
 ' ', hexadecimal value 0x0B, is an invalid character. Line 42, position 31.

Stack trace of exception you can see below:
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at ITSMS.DAL.SPLists.Lists.GetListItems(String listName, String viewName, XmlNode query, XmlNode viewFields, String rowLimit, XmlNode queryOptions, String webID)

INNER MESSAGE: ' ', hexadecimal value 0x0B, is an invalid character. Line 42, position 31.

   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(St

When opening the Reports site, I get "A name was started with an invalid character." error


Hello, I am running out of ideas on how to get SSRS to work.  I am trying get this setup with the intention to replace our Crystal Reports server.  Currently I have set up the RS Virtual Directory on a Win XP box.  The ReportServer database sits on another SQL2000 box. 

I can connect to the http://localhost/ReportServer/ on the XP box to display the page the depicts "Microsoft SQL Server Reporting Services Version 9.00.2047.00"  

When I connect to the http://localhost/Reports/, I get this error "A name was started with an invalid character. Error processing resource 'http://leej/Reports/'. Line 1, Position 2"   I checked my IIS Virtual Directory properties for Reports and ASP.NET is set to v2.0.50727.   I also executed "aspnet_regiis.exe -i" in the "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" directory.  

Any thought on how to fix this?  I hate to let this blocker deters us from deploying SSRS.



invalid character whil running the open xml script

hi i am facing problem while running the following sql statement

 SET NOCOUNT ON DECLARE @hDoc INT EXEC sp_xml_preparedocument @hDoc OUTPUT, '<NewDataSet> <Forms Layout=''&lt;StackPanel Background=&quot;#FFFFFFFF&quot; Name=&quot;StackPanelUser&quot; Width=&quot;1001&quot; Height=&quot;600&quot; Margin=&quot;10,5,10,5&quot; HorizontalAlignment=&quot;Center&quot; ClipToBounds=&quot;True&quot; twcdd:RadDragAndDropManager.AllowDrop=&quot;True&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:iedf=&quot;clr-namespace:Iris.Ews.Designer.Form;assembly=Iris.Ews.Designer.Form&quot; xmlns:twcdd=&quot;clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls&quot;&gt;&#xD;&#xA; &lt;ScrollViewer HorizontalScrollBarVisibility=&quot;Auto&quot; VerticalScrollBarVisibilit

SQL sp_xml_preparedocument - XML parsing error: An Invalid character was found in text content


SQL sp_xml_preparedocument - XML parsing error: An Invalid character was found in text content

I am sending an xml document to Sql Server as text and this error occurs only when sp_xml_preparedocument is called with special characters(öß) in the xml.

 I am using OPENXML to extract the data from the elements to store in tables, however SQL Servers sp_xml_preparedocument cause an exception with special characters.

As a temp fix,
I solved this issue by changeing the sql stored procedure parameter that accepts the XML document to ntext type and changed the table columns type to nvarchar. This allowed the special characters to be inserted without errors into SQL

Required Solution
Do i have any other solution to stayback with my text and varchar datatype rather than using ntext and nvarchar?

http://www.selvaonline.com - Live a Happy & Balanced Life

WebMatrix conversion failed when converting from a character string to uniqueidentifier?


I am trying to retrieve xml from a small function in my .cshtml page. Its throwing me an error. This however, runs fine in a console/form environment.

It takes 3 parameters and 1 exception.

myDll.GetXML(year, username, uniqueidentifier, out ex);

When I run this page I get the error, "Conversion failed when converting from a character string to uniqueidentifier."

Or a stack of.

System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBeha

Web Deployment Projects (WDP) arabic character



I built web project using asp.net & c# in VS2005 and i use arabic label in my project and every think working good when i run my application. but when i use WDP to make msi file All arabic letter come like ?????. 


Invalid length for a Base-64 char array for my coding in ASP.net C#. How to solve it ?


Hi Friends ,

I have done encrypted password and decode but i got error  like  this  " Invalid length for a Base-64 char array" .

Pls help . Thanks


psswd = txtPassword.Text;

pwed = base64Decode(psswd);

public string base64Decode(string sData)
            System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
            System.Text.Decoder utf8Decode = encoder.GetDecoder();
            byte[] todecode_byte = Convert.FromBase64String(sData);
            int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
            char[] decoded_char = new char[charCount];
            utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
            string result = new String(decoded_char); return result;

DirectX 8.0: Enhancing Real-Time Character Animation with Matrix Palette Skinning and Vertex Shaders


DirectX 8.0 allows the creation of smooth and realistic character movements that are more life-like than simple articulated structure animations. This is made possible by its improved support for vertex tweening and blended vertex deformations, also known as soft-skinning. After a brief history of the use of these techniques in DirectX, soft-skinning using the fixed function pipeline is discussed. This is followed by the use of matrix palettes from within vertex shaders to create a customized soft-skinning solution that takes advantage of the benefits of vertex shaders, such as hardware acceleration and custom lighting algorithms without the limitations of fixed-function solutions.

Benjamin Freidlin

MSDN Magazine June 2001

Linq2Sql error: "Invalid attempt to call Read when reader is closed."


I've read up on this error from other posts and on other sites, but haven't found a solid resolution to the issue yet. My setup is as follows:

I have a RepositoryBase class that fields certain db calls that all repositories need to perform. In one such call, "GetSecurityGroup", it works most of the time, but will seemingly at random throw an exception with the error "Invalid attempt to call Read when reader is closed." All other Repository classes inherit from this one, and they all use the same DataContext object, which I understand isn't thread safe. Since there could be multiple calls to the DataContext object on the same page, perhaps one is using the DataContext when the next tries to do so. I'm not sure. What can I do to ensure this doesn't happen?

How to CATCH "Invalid postback or callback argument" exception?



How can I catch this exception? I do not want it to stop my page execution. Can/Should I do that?

Server Error in '/' Application.
Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
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.ArgumentException: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally

WebResource.axd - Padding is invalid and cannot be removed error



I'm working on a site that is hosted externally, and the admin just sent me an email syaing they're getting this following error:


Event code: 3005 

Event message: An unhandled exception has occurred.

Event time: 11/17/2008 8:11:24 AM

Event time (UTC): 11/17/2008 8:11:24 AM

Event ID: 5d3b54c09a24463ca8fb03f22692e0bb

Event sequence: 731

Event occurrence: 3

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1776482879/ROOT-1-128713348984007217

Trust level: Full

Application Virtual Path: /

Application Path: D:\....

Machine name: ****

Process information:

Process ID: 2272

Process name: w3wp.exe

Account name: ****

Exception information:

Exception type: CryptographicException

Exception message: Padding is invalid and cannot be removed.

Request information:

Request URL: http://sitename/WebResource.axd?d=_O9D297IUE-qcgMP0yFe-w2&t=633468747532779057

Request path: /WebResource.axd

User host address:


Is authenticated: False

Authentication Type:

Thread ac
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend