Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Sun, 1 Jun 2008 02:24:01 -0700,    group: microsoft.public.sqlxml.viewmapper        back       


Please help with using an updategram   
Hi,
Can anybody help with this error message please:
HRESULT="0x80004005" Description="All updategram/diffgrams nodes with 
siblings must have ids, either user specified ones or mapping schema based 
key field id"

My schema: (Categories.xsd)
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
  <xsd:element name="Category" sql:relation="AssetCategories" >
   <xsd:complexType>
    	<xsd:attribute name="CategoryId" type="xsd:integer" 
sql:field="CategoryId" />
	<xsd:attribute name="CategoryName" type="xsd:string" 
sql:field="CategoryName" />
   </xsd:complexType>
  </xsd:element>
</xsd:schema>


My updategram:

<ROOT encoding="utf-8" xmlns:updg="urn:schemas-microsoft-com:xml-updategram">
	<updg:sync>
		<updg:before>
			<Category CategoryName="Software list" CategoryId="1"/>
			<Category CategoryName="Computer list" CategoryId="2"/>
		</updg:before>
		<updg:after>
			<Category CategoryName="Cables"/>
		</updg:after>
	</updg:sync>
</ROOT>


Dot NETcode:

  Dim cmd As New SqlXmlCommand(sConString)
        With cmd
            .CommandType = SqlXmlCommandType.UpdateGram
            .SchemaPath = "C:\Categories.xsd"
            .CommandText = sDoc
            .ExecuteNonQuery()
        End With
        cmd = Nothing



Thanks,
Mehran.
date: Sun, 1 Jun 2008 02:24:01 -0700   author:   Mehran

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us