No Schema Wanted with Data Adapter

G

Guest

Using batch SQL statements that return multiple results.

Dim ds As New DataSet
Dim cmd As New SqlCommand
cmd.CommandText = "SomeStoredProcedure"
cmd.Parameters.Add("@Id", "1")
Dim cn As New SqlConnection(ConnectionString)
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
Dim da As New SqlDataAdapter
da.SelectCommand = cmd
da.Fill(ds)

My problem is that the schema information is returned along with the data in
XML.

How do I prevent the schema information from being sent with the data?

Thanks.
 
D

David Lloyd

Tom:

I am not sure from your post why you do not want a schema. If your concern
is that you do not want the schema to be written when you use the WriteXML
method of the dataset, then you can use an overload of this method to
specify XMLWriteMode.IgnoreSchema.

If that is not your issue, I would suggest providing additional details
about what you are trying to accomplish.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
 
G

Guest

David,

The XML information coming across the net has two groups: XmlSchema and
XmlDataSet.

How do I keep the schema from going across the net with the data?

In the example below, how do I keep the top part form being added?

Thanks. Tom

<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://www.me.com/WsEmulator/Tester">
- <xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="tester">
- <xs:complexType>
- <xs:sequence>
<xs:element name="AddressId" type="xs:int" minOccurs="0" />
<xs:element name="city" type="xs:string" minOccurs="0" />
<xs:element name="state" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

**********Not add above **************

- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
- <tester diffgr:id="tester1" msdata:rowOrder="0">
<AddressId>1</AddressId>
<city>Little Rock</city>
<state>AZ</state>
</tester>
</NewDataSet>
</diffgr:diffgram>
</DataSet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top