Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 13th, 2005, 06:23 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Autonumber in a dataset

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)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
AutoNumber field tulincim Access 5 June 6th, 2006 03:44 PM
Help Needed in Autonumber! jamest Access VBA 3 February 3rd, 2005 03:52 PM
regarding Autonumber... MuthuAL Classic ASP Databases 2 December 8th, 2004 08:04 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.