Using
VB.NET, Is there a way to designate a column in a dataset as Autonumber when the dataset is read in from an XSD?
Or is there a way to programmatically change the column in the dataset after it has been read in from the XSD?
Public Sub ParseSchema(ByVal schema As String)
Dim myStreamReader As StreamReader = Nothing
Dim logWrite As New LogWriter
Try
myStreamReader = New StreamReader(schema)
logWrite.Log("Reading Schema file ...")
ASDataDocument.DataSet.ReadXmlSchema(myStreamReade r)
...
end sub
=========================
XSD SNIPPET:
=========================
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema" xmlns:od="urn:schemas-microsoft-com:officedata">
...
<xs:element name="SEQUENCE_NUMBER" nillable="false" od:jetType="autonumber" od:sqlSType="int" od:autoUnique="yes" od:nonNullable="yes" sql:relation="PB_VARDATA2" sql:field="SEQUENCE_NUMBER" sql:identity="useValue"/>
...
It reads in the Table and column name and creates the Dataset, but when I insert records into the table, the column for "SEQUENCE_NUMBER" remains null for all insertions (i.e. no Autonumbering)