Invalid character value for cast specification
问题 I am inserting data into SQL 2005 using SQLXMLBulkLoad.SQLXMLBulkload.3.0 My data table has following column: objDataTable.Columns.Add("TaskDateTime", System.Type.GetType("System.DateTime")) My bulk insert schema has following definition: <xsd:element name="DepartureTime" type="xsd:date" /> (Using xmlns:xsd="http://www.w3.org/2001/XMLSchema") And I am getting 'Invalid character value for cast specification' exception. Any advice? 回答1: Solved!. Changed column type from: objDataTable.Columns