Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid URI: The URI scheme is not valid.
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00692663
Message ID:
00692684
Vues:
37
There is no type called StringReader

>Aha...I know what it is.
>
>ReadSchema() has eight overloaded methods and none of them accepts String as XML..Try the following..
>
>
>StringReader loStream = new StringReader(lcXML);
>XmlTextReader loXmlTextReader = new XmlTextReader(loStream);
>	
>loDataSet.ReadXml((loXmlTextReader,XmlReadMode.ReadSchema);
>
>loStream.Close();
>loXmlTextReader.Close();
>
>
>
>>I've changed added XmlReadMode.ReadSchema, but I am still getting the same error.
>>
>>>You will have to tell ReadXml to actually read the schema. The following would work.
>>>
>>>dsStaff.ReadXml(lcStaffXML, XmlReadMode.ReadSchema);
>>>
>>>
>>>>I am getting the error "Invalid URI: The URI scheme is not valid." When I use ReadXML() into a dataset. I don't understand what the error means. Is the XML invalid? Any ideas what could be invalid about it?
>>>>
>>>>oStaff is a VFP COM object that returns a VFP cursor using CursorToXML with the following parameters.
>>>>
>>>>
>>>>= CURSORTOXML("cResult","lcXMLResult",1,0,0,"1")
>>>>
>>>>
>>>>
>>>>
>>>>// create staff object
>>>>int lnStaffID;
>>>>string lcStaffXML;
>>>>Staff oStaff = new Staff();
>>>>DataSet dsStaff = new DataSet();
>>>>
>>>>lnStaffID = Convert.ToInt32(Request.QueryString.Get("id"));
>>>>// get the XML string of the unchanged data
>>>>lcStaffXML = oStaff.GetRecord(lnStaffID);
>>>>// read xml string into a dataset
>>>>dsStaff.ReadXml(lcStaffXML);
>>>>
>>>>
>>>>Here is the XML string
>>>>
>>>>
>>>><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
>>>><VFPData>
>>>>	<xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
>>>>		<xsd:element name="VFPData" msdata:IsDataSet="true">
>>>>			<xsd:complexType>
>>>>				<xsd:choice maxOccurs="unbounded">
>>>>					<xsd:element name="cresult">
>>>>						<xsd:complexType>
>>>>							<xsd:sequence>
>>>>								<xsd:element name="id">
>>>>									<xsd:simpleType>
>>>>										<xsd:restriction base="xsd:decimal">
>>>>											<xsd:totalDigits value="7"/>
>>>>											<xsd:fractionDigits value="0"/>
>>>>										</xsd:restriction>
>>>>									</xsd:simpleType>
>>>>								</xsd:element>
>>>>								<xsd:element name="name">
>>>>									<xsd:simpleType>
>>>>										<xsd:restriction base="xsd:string">
>>>>											<xsd:maxLength value="20"/>
>>>>										</xsd:restriction>
>>>>									</xsd:simpleType>
>>>>								</xsd:element>
>>>>								<xsd:element name="info">
>>>>									<xsd:simpleType>
>>>>										<xsd:restriction base="xsd:string">
>>>>											<xsd:maxLength value="20"/>
>>>>										</xsd:restriction>
>>>>									</xsd:simpleType>
>>>>								</xsd:element>
>>>>								<xsd:element name="in" type="xsd:boolean"/>
>>>>							</xsd:sequence>
>>>>						</xsd:complexType>
>>>>					</xsd:element>
>>>>				</xsd:choice>
>>>>			</xsd:complexType>
>>>>		</xsd:element>
>>>>	</xsd:schema>
>>>>	<cresult>
>>>>		<id>23</id>
>>>>		<name>John Smith</name>
>>>>		<info>CSICU</info>
>>>>		<in>true</in>
>>>>	</cresult>
>>>></VFPData>
>>>>
>>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform