Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Dealing a Short datatype in VB.net

Posted on 2012-09-10
1
Medium Priority
?
355 Views
Last Modified: 2012-09-10
I have a field called(year built) with short data type ,need to validate that field with couple of validations how to that for 3 clauses??
1.Value should be equal to 9899 or be equal to or greater than '1600' and less than current date

Below is the code I have need to add these clauses :

    Private Sub YEARBUILT(ByVal Row As Input0Buffer)
        ColumnName = "YEAR_BUILT"

        If Row.inYEARBUILT_IsNull = True Then
            Row.outYEARBUILT_IsNull = True
        ElseIf Row.inYEARBUILT = 0 Then
            Row.outYEARBUILT_IsNull = True
       Else
           Row.outYEARBUILT = Row.inYEARBUILT
        End If
    End Sub
0
Comment
Question by:onebite2
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 38384153
Try:

Private Sub YEARBUILT(ByVal Row As Input0Buffer)
    ColumnName = "YEAR_BUILT"

    If Row.inYEARBUILT_IsNull = True Then
        Row.outYEARBUILT_IsNull = True
    ElseIf Row.inYEARBUILT = 0 Then
        Row.outYEARBUILT_IsNull = True
   ElseIf Row.inYEARBUILT = 9899 OrElse (Row.inYEARBUILT >= 1600 AndAlso Row.inYEARBUILT < DateTime.Now.Year)
       Row.outYEARBUILT = Row.inYEARBUILT
    End If
End Sub

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question