Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 139623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:28:06+00:00 2026-05-11T07:28:06+00:00

We have a highly specialized DAL which sits over our DB. Our apps need

  • 0

We have a highly specialized DAL which sits over our DB. Our apps need to use this DAL to correctly operate against this DB.

The generated DAL (which sits on some custom base classes) has various ‘Rec’ classes (Table1Rec, Table2Rec) each of which represents the record structure of a given table.

Here is a sample Pseudo-class…

Public Class SomeTableRec     Private mField1 As String     Private mField1isNull As Boolean     Private mField2 As Integer     Private mField2isNull As Boolean      Public Sub New()         mField1isNull = True         mField2isNull = True     End Sub     Public Property Field1() As String         Get             Return mField1         End Get         Set(ByVal value As String)             mField1 = value             mField1isNull = False         End Set     End Property     Public ReadOnly Property Field1isNull() As Boolean         Get             Return mField1isNull         End Get     End Property     Public Property Field2() As Integer         Get             Return mField2         End Get         Set(ByVal value As Integer)             mField2 = value             mField2isNull = False         End Set     End Property     Public ReadOnly Property Field2isNull() As Boolean         Get             Return mField2isNull         End Get     End Property End Class 

Each class has properties for each of the fields… Thus I can write…

Dim Rec as New Table1Rec Table1Rec.Field1 = 'SomeString' Table2Rec.Field2 = 500 

Where a field can accept a NULL value, there is an additional property which indicates if the value is currently null.

Thus….

Dim Rec as New Table1Rec Table1Rec.Field1 = 'SomeString' If Table1Rec.Field1Null then      ' This clearly is not true End If If Table1Rec.Field2Null then      ' This will be true End If 

This works because the constructor of the class sets all NULLproperties to True and the setting of any FieldProperty will cause the equivalent NullProperty to be set to false.

I have recently had the need to expose my DAL over the web through a web service (which I of course intend to secure) and have discovered that while the structure of the ‘Rec’ class remains intact over the web… All logic is lost..

If someone were to run the previous piece of code remotely they would notice that neither condition would prove true as there is no client side code which sets null to true.

I get the feeling I have architected this all wrong, but cannot see how I should improve it.

What is the correct way to architect this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:28:07+00:00Added an answer on May 11, 2026 at 7:28 am

    Not sure if I fully understand the question, but you can have nullable data types in XML.

    So this…

    Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols  <WebService(Namespace:='http://tempuri.org/')> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class Testing      Inherits System.Web.Services.WebService      <WebMethod()> _    Public Function GetObjects() As Generic.List(Of TestObject)         Dim list As New Generic.List(Of TestObject)         list.Add(New TestObject(Nothing, 'Empty ID Object'))         list.Add(New TestObject(1, 'Full ID Object'))         list.Add(New TestObject(2, Nothing))         Return list     End Function      Public Class TestObject         Public Sub New()             _name = String.Empty             _id = Nothing         End Sub         Public Sub New(ByVal id As Nullable(Of Integer), ByVal name As String)             _name = name             _id = id         End Sub         Private _name As String         Public Property Name() As String             Get                 Return _name             End Get             Set(ByVal value As String)                 _name = value             End Set         End Property          Private _id As Nullable(Of Integer)         Public Property ID() As Nullable(Of Integer)             Get                 Return _id             End Get             Set(ByVal value As Nullable(Of Integer))                 _id = value             End Set         End Property     End Class  End Class 

    outputs this (with nullable areas)

    <?xml version='1.0' encoding='utf-8' ?>  <ArrayOfTestObject xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns='http://tempuri.org/'>  <TestObject>   <Name>Empty ID Object</Name>    <ID xsi:nil='true' />   </TestObject>  <TestObject>   <Name>Full ID Object</Name>    <ID>1</ID>   </TestObject>  <TestObject>   <ID>2</ID>   </TestObject> </ArrayOfTestObject> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer KeyValuePair<K,V> is a struct, not a class. It's like doing:… May 11, 2026 at 9:54 am
  • added an answer I do not believe that F# has a conversion from… May 11, 2026 at 9:54 am
  • added an answer I'll go with IDataAccessOperation/IDataAccessService. This clearly shows the responsibility of… May 11, 2026 at 9:54 am

Related Questions

We have a requirement in project to store all the revisions(Change History) for the
We have a remoting singleton server running in a separate windows service (let's call
We have a Windows Server Web Edition 2003 Web Farm. What can we use
We have a situation where users are allowed to upload content, and then separately
We have a SharePoint list setup with history enabled so the Comments field keeps
We have a whole bunch of DLLs that give us access to our database
We have a service that has some settings that are supported only over net.tcp.
We have a few very large Excel workbooks (dozens of tabs, over a MB
We have a PHP project that we would like to version control. Right now
We have a junior programmer that simply doesn't write enough tests. I have to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.