Can I condense the following or how should I put it in its own sub routine.

Can I condense the following or how should I put it in its own sub routine.

 Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' Verify for Null fields
        If Not IsDBNull(_row.Account_Name) Then
            TextBox1.Text = _row.Account_Name
        Else
            TextBox1.Text = ""
        End If

        If Not IsDBNull(_row.Policy_Number) Then
            TextBox2.Text = _row.Policy_Number
        Else
            TextBox2.Text = ""
        End If

        If Not _row.IsOverride_Transaction_CodeNull Then
            TextBox3.Text = _row.Original_Transaction_Code
        Else
            TextBox3.Text = ""
        End If

        If Not IsDBNull(_row._Trans__Eff__Date) Then
            TextBox4.Text = _row._Trans__Eff__Date
        Else
            TextBox4.Text = ""
        End If

        If Not _row.IsOverride_ActionNull Then
            TextBox5.Text = _row.Override_Action
        Else
            TextBox5.Text = ""
        End If

        If Not _row.Is_Override_New_RenewalNull Then
            TextBox6.Text = _row._Override_New_Renewal
        Else
            TextBox6.Text = ""
        End If

        If Not _row.IsOverride_Transaction_CodeNull Then
            TextBox7.Text = _row.Override_Transaction_Code
        Else
            TextBox7.Text = ""
        End If

        If Not IsDBNull(_row.UserId) Then
            TextBox8.Text = _row.UserId
        Else
            TextBox8.Text = ""
        End If

        If Not IsDBNull(_row._Date) Then
            TextBox9.Text = _row._Date
        Else
            TextBox9.Text = ""
        End If


    End Sub
mathieu_cuprykAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi mathieu_cupryk;

Seeming that this is done during the EditForm_Load event if your textbox's were cleared of text at Design time then there is no need to clear them again. As to putting this code to its own sub if this is the only time you execute this code just leave it where it is.

 Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' Verify for Null fields
        If Not IsDBNull(_row.Account_Name) Then
            TextBox1.Text = _row.Account_Name
        End If

        If Not IsDBNull(_row.Policy_Number) Then
            TextBox2.Text = _row.Policy_Number
        End If

        If Not _row.IsOverride_Transaction_CodeNull Then
            TextBox3.Text = _row.Original_Transaction_Code
        End If

        If Not IsDBNull(_row._Trans__Eff__Date) Then
            TextBox4.Text = _row._Trans__Eff__Date
        End If

        If Not _row.IsOverride_ActionNull Then
            TextBox5.Text = _row.Override_Action
        End If

        If Not _row.Is_Override_New_RenewalNull Then
            TextBox6.Text = _row._Override_New_Renewal
        End If

        If Not _row.IsOverride_Transaction_CodeNull Then
            TextBox7.Text = _row.Override_Transaction_Code
        End If

        If Not IsDBNull(_row.UserId) Then
            TextBox8.Text = _row.UserId
        End If

        If Not IsDBNull(_row._Date) Then
            TextBox9.Text = _row._Date
        End If

    End Sub
mathieu_cuprykAuthor Commented:
Exactly but it looks messy the EditForm?
Fernando SotoRetiredCommented:
I don't know it does not look messy to me. I would just leave it with the change I gave you. Maybe some one else will check in and have a better idea.
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

amyhxuCommented:
One way is to do something like the following:

    Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

          FillTextBox("Account_Name", TextBox1)
          FillTextBox("Policy_Number", TextBox2)
          FillTextBox("Original_Transaction_Code", TextBox3)
          FillTextBox("_Trans__Eff__Date", TextBox4)
          ...

    End Sub

    Private Sub FillTextBox(ByVal colName As String, ByVal tb As TextBox)

        If Not IsDBNull(_row(colName)) Then
            tb.Text = _row(colName)
        End If

    End Sub


But I really don't think the original way of coding is messy, I actually prefer to code in that way. The reason I gave you the  -- Else TextBox1.Text = "" --  is so that you can set the default value of that textbox when the value in the row is null. E.g. For a numeric field, you may want to set the textbox to display value 0 instead of showing nothing -- Else TextBox.Text = 0 --   Of course if you don't need to set the default value, you can always get rid of the "Else" part as Fernando suggested.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mathieu_cuprykAuthor Commented:
I like this way because I program in C# it looks clean.

But I get an error.

An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: Column 'Account_Name' does not belong to table AcctNames.

Private Sub FillTextBox(ByVal colName As String, ByVal tb As TextBox)

        If Not IsDBNull(_row(colName)) Then
            tb.Text = _row(colName)
        Else
            tb.Text = ""
        End If

    End Sub


    Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' Verify for Null fields
        FillTextBox("Account_Name", TextBox1)
       

amyhxuCommented:
I am not sure what is wrong with that if you are sure "Account_Name" is the exact column name in table "AcctNames".
amyhxuCommented:
Alternatively, you can use column number instead of column name:

Private Sub FillTextBox(ByVal colNo As Integer, ByVal tb As TextBox)

        If Not IsDBNull(_row(colNo)) Then
            tb.Text = _row(colNo)
        End If

    End Sub


    Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        ' Verify for Null fields
        FillTextBox(0, TextBox1)


But this way you have to make sure the column index in the datatable is the one you want to display in this textbox.
mathieu_cuprykAuthor Commented:
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: Column '0' does not belong to table AcctNames.

This is problematic as well. Because I am linking the tables.
amyhxuCommented:
So what's in your dataset? How many tables do you have?
mathieu_cuprykAuthor Commented:
I have three tables

To get the Account Name I need the Policy number and I use this to get the Account ID
Once I get the Account ID I use this to get the Account Name.

I have my main table which is my transoverride table that contains the policy number. From there I get the Account ID from table AccIDPolicyX and use this to get Account Name from AccNames table.

<?xml version="1.0" standalone="yes" ?>
<xs:schema id="DataSet1" targetNamespace="http://www.tempuri.org/DataSet1.xsd" xmlns:mstns="http://www.tempuri.org/DataSet1.xsd"
      xmlns="http://www.tempuri.org/DataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
      <xs:element name="DataSet1" msdata:IsDataSet="true">
            <xs:complexType>
                  <xs:choice maxOccurs="unbounded">
                        <xs:element name="AcctNames">
                              <xs:complexType>
                                    <xs:sequence>
                                          <xs:element name="Account_x0020_Name" type="xs:string" />
                                          <xs:element name="Policy_x0020_Number" type="xs:string" />
                                          <xs:element name="Original_x0020_Transaction_x0020_Code" type="xs:string" />
                                          <xs:element name="Trans._x0020_Eff._x0020_Date" type="xs:dateTime" />
                                          <xs:element name="Override_x0020_Action" type="xs:string" minOccurs="0" />
                                          <xs:element name="Override_x0020_New_x002F_Renewal" type="xs:string" minOccurs="0" />
                                          <xs:element name="Override_x0020_Transaction_x0020_Code" type="xs:string" minOccurs="0" />
                                          <xs:element name="UserId" type="xs:string" />
                                          <xs:element name="Date" type="xs:dateTime" />
                                    </xs:sequence>
                              </xs:complexType>
                        </xs:element>
                  </xs:choice>
            </xs:complexType>
      </xs:element>
</xs:schem
amyhxuCommented:
From the xsd code you posted, I can only tell there's one dataset called "DataSet1" and there's one datatable "AcctNames" in the dataset. Do you have other datasets or do you have other datatables in Dataset1 as you mentioned you have other two tables?
mathieu_cuprykAuthor Commented:
I only have one dataset.
'------------------------------------------------------------------------------
' <autogenerated>
'     This code was generated by a tool.
'     Runtime Version: 1.1.4322.2032
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </autogenerated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.Data
Imports System.Runtime.Serialization
Imports System.Xml


<Serializable(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Diagnostics.DebuggerStepThrough(),  _
 System.ComponentModel.ToolboxItem(true)>  _
Public Class DataSet1
    Inherits DataSet
   
    Private tableAcctNames As AcctNamesDataTable
   
    Public Sub New()
        MyBase.New
        Me.InitClass
        Dim schemaChangedHandler As System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
        AddHandler Me.Tables.CollectionChanged, schemaChangedHandler
        AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
    End Sub
   
    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
        MyBase.New
        Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(System.String)),String)
        If (Not (strSchema) Is Nothing) Then
            Dim ds As DataSet = New DataSet
            ds.ReadXmlSchema(New XmlTextReader(New System.IO.StringReader(strSchema)))
            If (Not (ds.Tables("AcctNames")) Is Nothing) Then
                Me.Tables.Add(New AcctNamesDataTable(ds.Tables("AcctNames")))
            End If
            Me.DataSetName = ds.DataSetName
            Me.Prefix = ds.Prefix
            Me.Namespace = ds.Namespace
            Me.Locale = ds.Locale
            Me.CaseSensitive = ds.CaseSensitive
            Me.EnforceConstraints = ds.EnforceConstraints
            Me.Merge(ds, false, System.Data.MissingSchemaAction.Add)
            Me.InitVars
        Else
            Me.InitClass
        End If
        Me.GetSerializationData(info, context)
        Dim schemaChangedHandler As System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
        AddHandler Me.Tables.CollectionChanged, schemaChangedHandler
        AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
    End Sub
   
    <System.ComponentModel.Browsable(false),  _
     System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)>  _
    Public ReadOnly Property AcctNames As AcctNamesDataTable
        Get
            Return Me.tableAcctNames
        End Get
    End Property
   
    Public Overrides Function Clone() As DataSet
        Dim cln As DataSet1 = CType(MyBase.Clone,DataSet1)
        cln.InitVars
        Return cln
    End Function
   
    Protected Overrides Function ShouldSerializeTables() As Boolean
        Return false
    End Function
   
    Protected Overrides Function ShouldSerializeRelations() As Boolean
        Return false
    End Function
   
    Protected Overrides Sub ReadXmlSerializable(ByVal reader As XmlReader)
        Me.Reset
        Dim ds As DataSet = New DataSet
        ds.ReadXml(reader)
        If (Not (ds.Tables("AcctNames")) Is Nothing) Then
            Me.Tables.Add(New AcctNamesDataTable(ds.Tables("AcctNames")))
        End If
        Me.DataSetName = ds.DataSetName
        Me.Prefix = ds.Prefix
        Me.Namespace = ds.Namespace
        Me.Locale = ds.Locale
        Me.CaseSensitive = ds.CaseSensitive
        Me.EnforceConstraints = ds.EnforceConstraints
        Me.Merge(ds, false, System.Data.MissingSchemaAction.Add)
        Me.InitVars
    End Sub
   
    Protected Overrides Function GetSchemaSerializable() As System.Xml.Schema.XmlSchema
        Dim stream As System.IO.MemoryStream = New System.IO.MemoryStream
        Me.WriteXmlSchema(New XmlTextWriter(stream, Nothing))
        stream.Position = 0
        Return System.Xml.Schema.XmlSchema.Read(New XmlTextReader(stream), Nothing)
    End Function
   
    Friend Sub InitVars()
        Me.tableAcctNames = CType(Me.Tables("AcctNames"),AcctNamesDataTable)
        If (Not (Me.tableAcctNames) Is Nothing) Then
            Me.tableAcctNames.InitVars
        End If
    End Sub
   
    Private Sub InitClass()
        Me.DataSetName = "DataSet1"
        Me.Prefix = ""
        Me.Namespace = "http://www.tempuri.org/DataSet1.xsd"
        Me.Locale = New System.Globalization.CultureInfo("en-US")
        Me.CaseSensitive = false
        Me.EnforceConstraints = true
        Me.tableAcctNames = New AcctNamesDataTable
        Me.Tables.Add(Me.tableAcctNames)
    End Sub
   
    Private Function ShouldSerializeAcctNames() As Boolean
        Return false
    End Function
   
    Private Sub SchemaChanged(ByVal sender As Object, ByVal e As System.ComponentModel.CollectionChangeEventArgs)
        If (e.Action = System.ComponentModel.CollectionChangeAction.Remove) Then
            Me.InitVars
        End If
    End Sub
   
    Public Delegate Sub AcctNamesRowChangeEventHandler(ByVal sender As Object, ByVal e As AcctNamesRowChangeEvent)
   
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class AcctNamesDataTable
        Inherits DataTable
        Implements System.Collections.IEnumerable
       
        Private columnAccount_Name As DataColumn
       
        Private columnPolicy_Number As DataColumn
       
        Private columnOriginal_Transaction_Code As DataColumn
       
        Private column_Trans__Eff__Date As DataColumn
       
        Private columnOverride_Action As DataColumn
       
        Private column_Override_New_Renewal As DataColumn
       
        Private columnOverride_Transaction_Code As DataColumn
       
        Private columnUserId As DataColumn
       
        Private column_Date As DataColumn
       
        Friend Sub New()
            MyBase.New("AcctNames")
            Me.InitClass
        End Sub
       
        Friend Sub New(ByVal table As DataTable)
            MyBase.New(table.TableName)
            If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
                Me.CaseSensitive = table.CaseSensitive
            End If
            If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
                Me.Locale = table.Locale
            End If
            If (table.Namespace <> table.DataSet.Namespace) Then
                Me.Namespace = table.Namespace
            End If
            Me.Prefix = table.Prefix
            Me.MinimumCapacity = table.MinimumCapacity
            Me.DisplayExpression = table.DisplayExpression
        End Sub
       
        <System.ComponentModel.Browsable(false)>  _
        Public ReadOnly Property Count As Integer
            Get
                Return Me.Rows.Count
            End Get
        End Property
       
        Friend ReadOnly Property Account_NameColumn As DataColumn
            Get
                Return Me.columnAccount_Name
            End Get
        End Property
       
        Friend ReadOnly Property Policy_NumberColumn As DataColumn
            Get
                Return Me.columnPolicy_Number
            End Get
        End Property
       
        Friend ReadOnly Property Original_Transaction_CodeColumn As DataColumn
            Get
                Return Me.columnOriginal_Transaction_Code
            End Get
        End Property
       
        Friend ReadOnly Property _Trans__Eff__DateColumn As DataColumn
            Get
                Return Me.column_Trans__Eff__Date
            End Get
        End Property
       
        Friend ReadOnly Property Override_ActionColumn As DataColumn
            Get
                Return Me.columnOverride_Action
            End Get
        End Property
       
        Friend ReadOnly Property _Override_New_RenewalColumn As DataColumn
            Get
                Return Me.column_Override_New_Renewal
            End Get
        End Property
       
        Friend ReadOnly Property Override_Transaction_CodeColumn As DataColumn
            Get
                Return Me.columnOverride_Transaction_Code
            End Get
        End Property
       
        Friend ReadOnly Property UserIdColumn As DataColumn
            Get
                Return Me.columnUserId
            End Get
        End Property
       
        Friend ReadOnly Property _DateColumn As DataColumn
            Get
                Return Me.column_Date
            End Get
        End Property
       
        Public Default ReadOnly Property Item(ByVal index As Integer) As AcctNamesRow
            Get
                Return CType(Me.Rows(index),AcctNamesRow)
            End Get
        End Property
       
        Public Event AcctNamesRowChanged As AcctNamesRowChangeEventHandler
       
        Public Event AcctNamesRowChanging As AcctNamesRowChangeEventHandler
       
        Public Event AcctNamesRowDeleted As AcctNamesRowChangeEventHandler
       
        Public Event AcctNamesRowDeleting As AcctNamesRowChangeEventHandler
       
        Public Overloads Sub AddAcctNamesRow(ByVal row As AcctNamesRow)
            Me.Rows.Add(row)
        End Sub
       
        Public Overloads Function AddAcctNamesRow(ByVal Account_Name As String, ByVal Policy_Number As String, ByVal Original_Transaction_Code As String, ByVal _Trans__Eff__Date As Date, ByVal Override_Action As String, ByVal _Override_New_Renewal As String, ByVal Override_Transaction_Code As String, ByVal UserId As String, ByVal _Date As Date) As AcctNamesRow
            Dim rowAcctNamesRow As AcctNamesRow = CType(Me.NewRow,AcctNamesRow)
            rowAcctNamesRow.ItemArray = New Object() {Account_Name, Policy_Number, Original_Transaction_Code, _Trans__Eff__Date, Override_Action, _Override_New_Renewal, Override_Transaction_Code, UserId, _Date}
            Me.Rows.Add(rowAcctNamesRow)
            Return rowAcctNamesRow
        End Function
       
        Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
            Return Me.Rows.GetEnumerator
        End Function
       
        Public Overrides Function Clone() As DataTable
            Dim cln As AcctNamesDataTable = CType(MyBase.Clone,AcctNamesDataTable)
            cln.InitVars
            Return cln
        End Function
       
        Protected Overrides Function CreateInstance() As DataTable
            Return New AcctNamesDataTable
        End Function
       
        Friend Sub InitVars()
            Me.columnAccount_Name = Me.Columns("Account Name")
            Me.columnPolicy_Number = Me.Columns("Policy Number")
            Me.columnOriginal_Transaction_Code = Me.Columns("Original Transaction Code")
            Me.column_Trans__Eff__Date = Me.Columns("Trans. Eff. Date")
            Me.columnOverride_Action = Me.Columns("Override Action")
            Me.column_Override_New_Renewal = Me.Columns("Override New/Renewal")
            Me.columnOverride_Transaction_Code = Me.Columns("Override Transaction Code")
            Me.columnUserId = Me.Columns("UserId")
            Me.column_Date = Me.Columns("Date")
        End Sub
       
        Private Sub InitClass()
            Me.columnAccount_Name = New DataColumn("Account Name", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnAccount_Name)
            Me.columnPolicy_Number = New DataColumn("Policy Number", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnPolicy_Number)
            Me.columnOriginal_Transaction_Code = New DataColumn("Original Transaction Code", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnOriginal_Transaction_Code)
            Me.column_Trans__Eff__Date = New DataColumn("Trans. Eff. Date", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column_Trans__Eff__Date)
            Me.columnOverride_Action = New DataColumn("Override Action", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnOverride_Action)
            Me.column_Override_New_Renewal = New DataColumn("Override New/Renewal", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column_Override_New_Renewal)
            Me.columnOverride_Transaction_Code = New DataColumn("Override Transaction Code", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnOverride_Transaction_Code)
            Me.columnUserId = New DataColumn("UserId", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnUserId)
            Me.column_Date = New DataColumn("Date", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column_Date)
            Me.columnAccount_Name.AllowDBNull = false
            Me.columnPolicy_Number.AllowDBNull = false
            Me.columnOriginal_Transaction_Code.AllowDBNull = false
            Me.column_Trans__Eff__Date.AllowDBNull = false
            Me.columnUserId.AllowDBNull = false
            Me.column_Date.AllowDBNull = false
        End Sub
       
        Public Function NewAcctNamesRow() As AcctNamesRow
            Return CType(Me.NewRow,AcctNamesRow)
        End Function
       
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New AcctNamesRow(builder)
        End Function
       
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(AcctNamesRow)
        End Function
       
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.AcctNamesRowChangedEvent) Is Nothing) Then
                RaiseEvent AcctNamesRowChanged(Me, New AcctNamesRowChangeEvent(CType(e.Row,AcctNamesRow), e.Action))
            End If
        End Sub
       
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.AcctNamesRowChangingEvent) Is Nothing) Then
                RaiseEvent AcctNamesRowChanging(Me, New AcctNamesRowChangeEvent(CType(e.Row,AcctNamesRow), e.Action))
            End If
        End Sub
       
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.AcctNamesRowDeletedEvent) Is Nothing) Then
                RaiseEvent AcctNamesRowDeleted(Me, New AcctNamesRowChangeEvent(CType(e.Row,AcctNamesRow), e.Action))
            End If
        End Sub
       
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.AcctNamesRowDeletingEvent) Is Nothing) Then
                RaiseEvent AcctNamesRowDeleting(Me, New AcctNamesRowChangeEvent(CType(e.Row,AcctNamesRow), e.Action))
            End If
        End Sub
       
        Public Sub RemoveAcctNamesRow(ByVal row As AcctNamesRow)
            Me.Rows.Remove(row)
        End Sub
    End Class
   
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class AcctNamesRow
        Inherits DataRow
       
        Private tableAcctNames As AcctNamesDataTable
       
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tableAcctNames = CType(Me.Table,AcctNamesDataTable)
        End Sub
       
        Public Property Account_Name As String
            Get
                Return CType(Me(Me.tableAcctNames.Account_NameColumn),String)
            End Get
            Set
                Me(Me.tableAcctNames.Account_NameColumn) = value
            End Set
        End Property
       
        Public Property Policy_Number As String
            Get
                Return CType(Me(Me.tableAcctNames.Policy_NumberColumn),String)
            End Get
            Set
                Me(Me.tableAcctNames.Policy_NumberColumn) = value
            End Set
        End Property
       
        Public Property Original_Transaction_Code As String
            Get
                Return CType(Me(Me.tableAcctNames.Original_Transaction_CodeColumn),String)
            End Get
            Set
                Me(Me.tableAcctNames.Original_Transaction_CodeColumn) = value
            End Set
        End Property
       
        Public Property _Trans__Eff__Date As Date
            Get
                Return CType(Me(Me.tableAcctNames._Trans__Eff__DateColumn),Date)
            End Get
            Set
                Me(Me.tableAcctNames._Trans__Eff__DateColumn) = value
            End Set
        End Property
       
        Public Property Override_Action As String
            Get
                Try
                    Return CType(Me(Me.tableAcctNames.Override_ActionColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableAcctNames.Override_ActionColumn) = value
            End Set
        End Property
       
        Public Property _Override_New_Renewal As String
            Get
                Try
                    Return CType(Me(Me.tableAcctNames._Override_New_RenewalColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableAcctNames._Override_New_RenewalColumn) = value
            End Set
        End Property
       
        Public Property Override_Transaction_Code As String
            Get
                Try
                    Return CType(Me(Me.tableAcctNames.Override_Transaction_CodeColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableAcctNames.Override_Transaction_CodeColumn) = value
            End Set
        End Property
       
        Public Property UserId As String
            Get
                Return CType(Me(Me.tableAcctNames.UserIdColumn),String)
            End Get
            Set
                Me(Me.tableAcctNames.UserIdColumn) = value
            End Set
        End Property
       
        Public Property _Date As Date
            Get
                Return CType(Me(Me.tableAcctNames._DateColumn),Date)
            End Get
            Set
                Me(Me.tableAcctNames._DateColumn) = value
            End Set
        End Property
       
        Public Function IsOverride_ActionNull() As Boolean
            Return Me.IsNull(Me.tableAcctNames.Override_ActionColumn)
        End Function
       
        Public Sub SetOverride_ActionNull()
            Me(Me.tableAcctNames.Override_ActionColumn) = System.Convert.DBNull
        End Sub
       
        Public Function Is_Override_New_RenewalNull() As Boolean
            Return Me.IsNull(Me.tableAcctNames._Override_New_RenewalColumn)
        End Function
       
        Public Sub Set_Override_New_RenewalNull()
            Me(Me.tableAcctNames._Override_New_RenewalColumn) = System.Convert.DBNull
        End Sub
       
        Public Function IsOverride_Transaction_CodeNull() As Boolean
            Return Me.IsNull(Me.tableAcctNames.Override_Transaction_CodeColumn)
        End Function
       
        Public Sub SetOverride_Transaction_CodeNull()
            Me(Me.tableAcctNames.Override_Transaction_CodeColumn) = System.Convert.DBNull
        End Sub
    End Class
   
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class AcctNamesRowChangeEvent
        Inherits EventArgs
       
        Private eventRow As AcctNamesRow
       
        Private eventAction As DataRowAction
       
        Public Sub New(ByVal row As AcctNamesRow, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
       
        Public ReadOnly Property Row As AcctNamesRow
            Get
                Return Me.eventRow
            End Get
        End Property
       
        Public ReadOnly Property Action As DataRowAction
            Get
                Return Me.eventAction
            End Get
        End Property
    End Class
End Class
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.