My requirement is to create a XML file based on an XSD.
The source data for this file will be coming from a database. For the purposes of this test, I am trying to manually assign the values.

I followed these steps:

1) Used the XSD.exe to create a VB Class.
PHP Code:
xsd //l:VB emprec.xsd /n:XSDSchema.EmpCollection 
2) Added the VB Class in my project.
3) If I try to compile my code, I get an error.

Here's the code I wrote:
VB.NET Code:
  1. Private Sub cmdXML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdXML.Click
  2.         Dim emp As New EMPLOYEE_COLLECTION
  3.         Dim empDataTable As New EMPLOYEE_COLLECTION.EMPLOYEE_RECORDDataTable
  4.         Dim empDataRow As New EMPLOYEE_COLLECTION.EMPLOYEE_RECORDRow
  5.  
  6.         Dim empDataReader As DataTableReader = empDataTable.CreateDataReader()
  7.  
  8.         Dim x As Integer
  9.  
  10.         For x = 1 To 5
  11.             empDataRow.EMPLOYEE_NO = "AISGM"
  12.             empDataRow.FIRSTNAME = "Abhijit"
  13.             empDataRow.LASTNAME = "IsGettingMad"
  14.             empDataRow.NTID = "DONTGETMAD"
  15.             empDataTable.AddEMPLOYEE_RECORDRow(empDataRow)
  16.             empDataRow.ClearErrors()
  17.         Next x

The error I get is
PHP Code:
Error    1    First statement of this 'Sub New' must be a call to 'MyBase.New' or 'MyClass.New' because base class 'System.Data.DataRow' of 'writeXMLbasedonXSD.XSDSchema.EmpCollection.EMPLOYEE_COLLECTION.EMPLOYEE_RECORDRow' does not have an accessible 'Sub New' that can be called with no arguments.    D:\Visual Studio 2010\Projects\writeXMLbasedonXSD\writeXMLbasedonXSD\emprec.vb    598    17    writeXMLbasedonXSD 
This is the code from the class that was generated using XSD utility.
VB.NET Code:
  1. Partial Public Class EMPLOYEE_RECORDRow
  2.             Inherits Global.System.Data.DataRow
  3.  
  4.             Private tableEMPLOYEE_RECORD As EMPLOYEE_RECORDDataTable
  5.  
  6.             <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
  7.              Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
  8.             Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder)
  9.                 MyBase.New(rb)
  10.                 Me.tableEMPLOYEE_RECORD = CType(Me.Table, EMPLOYEE_RECORDDataTable)
  11.             End Sub
  12.  
  13.             Sub New()
  14.                 ' TODO: Complete member initialization
  15.  
  16.                 'I AM UNABLE TO ADD ANY CODE HERE.
  17.             End Sub
  18.  
  19.             <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
  20.              Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
  21.             Public Property EMPLOYEE_NO() As String
  22.                 Get
  23.                     Return CType(Me(Me.tableEMPLOYEE_RECORD.EMPLOYEE_NOColumn), String)
  24.                 End Get
  25.                 Set(ByVal value As String)
  26.                     Me(Me.tableEMPLOYEE_RECORD.EMPLOYEE_NOColumn) = value
  27.                 End Set
  28.             End Property
  29.  
  30.             <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
  31.              Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
  32.             Public Property FIRSTNAME() As String
  33.                 Get
  34.                     Return CType(Me(Me.tableEMPLOYEE_RECORD.FIRSTNAMEColumn), String)
  35.                 End Get
  36.                 Set(ByVal value As String)
  37.                     Me(Me.tableEMPLOYEE_RECORD.FIRSTNAMEColumn) = value
  38.                 End Set
  39.             End Property
  40.  
  41.             <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
  42.              Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
  43.             Public Property LASTNAME() As String
  44.                 Get
  45.                     Return CType(Me(Me.tableEMPLOYEE_RECORD.LASTNAMEColumn), String)
  46.                 End Get
  47.                 Set(ByVal value As String)
  48.                     Me(Me.tableEMPLOYEE_RECORD.LASTNAMEColumn) = value
  49.                 End Set
  50.             End Property
  51.  
  52.             <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
  53.              Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _
  54.             Public Property NTID() As String
  55.                 Get
  56.                     Return CType(Me(Me.tableEMPLOYEE_RECORD.NTIDColumn), String)
  57.                 End Get
  58.                 Set(ByVal value As String)
  59.                     Me(Me.tableEMPLOYEE_RECORD.NTIDColumn) = value
  60.                 End Set
  61.             End Property
  62.         End Class

How do I resolve this? I am unable to add any code in the 'TODO section for this generated class. What am I missing?