Data Type Summary (Visual Basic)

Visual Basic type Common language runtime type structure Nominal storage allocation Value range Boolean Boolean Depends on implementing platform TrueFalse Byte Byte 1 byte 0 through 255 (unsigned) Char (single character) Char 2 bytes 0 through 65535 (unsigned) Date   class=SpellE>DateTime 8 bytes 0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31, 9999 Decimal Decimal 16 bytes 0 through +/-79,228,162,514,264,337,593,543,950,335 (+/-7.9…E+28) † with no decimal point; 0 through +/-7.9228162514264337593543950335 with 28 places […]

Controlling Variables in For Loops

The For and For Each loops let you define their controlling variable as a block variable, using this syntax: For i As Integer = 1 To 10 … Next This syntax was introduced in Visual Studio.NET 2003. Many books and articles, however, continue to use the old syntax: Dim i As Integer For i = 1 To 10    … Next The new syntax is preferred in all cases because it prevents you from accidentally reusing […]

AJAX Drop Down List – Part Three

In the part one and part two of AJAX Drop Down List tutorial, I have described how to populate a drop down list with plain string data and XML string data respectively. If you followed the first two parts of the tutorial and built your drop down list, you will probably notice that you cannot use “ddlChildList.SelectedValue” to retrieve the value from the drop down list. The reason is that the drop down list is […]

AJAX Drop Down List – Part Two

In the part one of AJAX Drop Down List tutorial, I described how to popuate a child drop down list with plain string data. In this post, I will describe how to use XML data to populate the child drop down list. There are not gonna be many changes, so I will just address those need to be changed. 1. Client Side Page – ProductList.aspx There is no chnage except the JavaScript code, I will […]

AJAX Drop Down List – Part One

I wrote a tutorial on using AJAX technology in ASP.NET applications, and it only shows a very simple but common use of AJAX. Another common use of AJAX is to populate a drop down list based on the selection of another drop down list without using post back. It is especially useful when populating a large drop down list and the connection is not so fast. Let’s get started. Before we go too far, let’s […]

“ConstraintException Was Unhandled – Column is Constrained to be Unique…” error

I like to use DataAdapter to create a Data Access Layer to manipulate data in my applications. One of the advantages of using DataAdapter is that it allows you to insert/update/delete data in a batch mode by using Strong Tyed DataTable. How it works? Every record in the Strong Typed DataTable has a property called RowState that keeps track of the status of the record. For example, when a record is deleted from DataTable, the […]

I fixed our laptop!!!

Our old laptop has been giving us problems for about two years. When I am surfing the Internet, the laptop will freeze up unexpectedly, especially if I scroll the page up and down frequently, then the laptop will freeze up. I have tried several ways to fix the problem, but in vain. Here are the methods I have tried before: Reinstall Windows XP. Yeah, it is always our first choice when we deal with Windows […]

Oracel Date function

When it comes to handling date and time, Oracle PL/SQL is not as easy or convenient as Microsoft SQL. For instance, with MS SQL, you can write a query like: SELECT * FROM SomeTable WHERE DateAdded = ’09-29-2006 08:00:00 AM’ But with PL/SQL, the above query will not run and will generate an error message like ‘not a valid month’. To make it work, you have to use “To_Date” function to convert the DateTime string […]

How to make a HTML table fill the whole screen

When creating a table with width=100%, the table will not fill the whole screen and there is a thin white space between the screen and the top, left, and right side of the table. To make the table actually fill the whole screen, we need to use CSS. In the CSS file, add “margin: 0px; padding: 0px;” to the Body tag as follows: Body { … margin: 0px; padding: 0px; } If you use FireFox, […]

File size limitations with the File Field Control in ASP.NET

By default, the maximum size of a file to be uploaded to the server using the File Field control is around 4MB. But we can make some changes in either the machine.config or web.config to increase or decrease the size limitations: In the machine.config file, find a node called <httpRuntime> that looks like the following: <httpRuntime executionTimeout = “90” maxRequestLength = “4096” useFullyQualifiedRedirectUrl = “false” minFreeThreads = “8” minLocalRequestFreeThreads = “4” appRequestQueueLimit = “1000” /> […]