MyMovies Video Kiosk The Solution
As mentioned in the preceding section, the solution is to automate the existing system. In other words, any customer walking into the store should be able to use a computer running an application that provides all the information related to a movie, such as the name of the movie, its cast, and the director's name. Using this information, the customer can then decide whether or not to buy the movie. In addition, customers should be able to search for a movie based on some criteria, such as its...
The GetUpperBound Method
The GetUpperBound method takes the dimension of an array as a parameter and returns the upper bound of the specified dimension. The syntax for this method is as follows ArrayName refers to the name of the array whose upper bound you want to find. Dimension refers to the dimension number for which you want to find the upper bound. You use 0 for the first dimension, 1 for the second dimension, and so on. BoundVar BooksArray.GetUpperBound 0 'Returns 10 BoundVar BooksArray.GetUpperBound 2
MyMovies Video Kiosk The Present Scenario
MyMovies is a video company based in New Jersey. The company sells movie videos and also provides information about the movies. The company owns a chain of stores in various cities across the United States. MyMovies enjoyed its monopoly in the video-selling market until few months back. Let's take a look at the company's existing system to identify reasons why the company is losing its market share in the movie video market. Each MyMovies store provides information about movies in catalogs, and...
Creating a Simple Web Service in the NET Framework
This section will show you how to create a simple Web service in the .NET framework. This Web service will contain a default HelloWorld Web method. The following tasks will be involved when creating the Web service Create a blank Web service project. Create the appropriate Web methods in the Web service. Compile and test the Web service. Let's name this Web service as MyFirstWebService. You can create a Web service by using the ASP.NET Web Service template in the New Project dialog box. In the...
The IfThenElse Statement
You use the If Then Else statement to execute one or more statements based on a condition. This condition is a Boolean expression that can either return True or False. The following is the syntax for the If Then Else statement In the preceding syntax, Condition is the expression that is evaluated. If this expression returns True, the statements following Then are executed. If this expression returns False, the statements following Else are executed. Note that Else is an optional statement and...
Changes in the Upgraded Project
To view changes made to the upgraded project, you need to view its code. To view the code, double-click the Form1.vb file in the Solution Explorer window. The form displays in the designer. Select Code from the View menu to view the code associated with the form. Listing 8-2 contains the code for the upgraded project. Listing 8-2 The PrjLenConversion.NET Project Listing 8-2 The PrjLenConversion.NET Project Option Explicit On Friend Class LenConverter 'Added by the Visual Basic Upgrade Wizard...
The DatePart Function
You can use the DatePart function to extract a specific part or component such as the month, quarter, or day from a date. The syntax for the DatePart function is as follows Interval is a string expression that refers to the type of interval. Some examples are Datelnterval.Hour, Datelnterval.Second, and Datelnterval.Year. For specifying the Interval, you can use the Dateinterval enumeration provided by Visual Basic.NET. Table 7-9 lists the Dateinterval enumeration members along with their string...
The MessageBox Class
You can display messages which can contain text, buttons, and symbols using the MessageBox class. This class is contained in the System.Windows.Forms namespace and provides various methods such as Show, ToString, and Equals. However, the most common method is the Show method. As the name suggests, the Show method is used to display a message box. This method has been overloaded in the class. This means that many forms are available in the class for this method. This section examines one of the...
The CustomValidator1ServerValidate Function
The code for the CustomValidator1_ServerValidate function is as follows Private Sub CustomValidator1_ServerValidate ByVal source As System.Object, ByVal args As Handles CustomValidator1 .ServerValidate Dim sConnectionString As String Dim sqlString As String Dim MyDataAdapter As SqlDataAdapter Dim DS As New DataSet sConnectionString Application strConnect sqlString Select from Customer where CustID ' args.Value MyConnection New SqlConnection sConnectionString MyDataAdapter New SqlDataAdapter...
The Insert Movie Form 1
The Insert Video form enables the administrator to add records to the Movie table. Figure 20-5 displays the Insert Movie form. Movie ID Movie Title Drector ID Producer ID Duration Description Category Release Year Figure 20-5 The interface of the Insert Movie form Just as you imported namespaces and declared variables in the preceding forms, you need to do so in the Insert Movie form. In the Insert Movie form, you need to import the same namespaces and declare the same variables as you declared...
The Insert Customer Form 1
The administrator can use the Insert Customer form to add records to the Customer table. Figure 20-6 shows the Insert Customer form. Figure 20-6 The interface of the Insert Customer form Before you write the code for the Insert Customer form, you need to import namespaces and declare the variables in the form. Similar to the forms already discussed, the Insert Customer form contains the following functions SetUpdatelD FrmlnsertVideo Load CmdSubmit_Click CmdCancel_Click The complete code for the...
The CustomValidator1ServerValidate Function 1
The CustomValidator1_ServerValidate function validates the customer ID. The code for the function is as follows Private Sub CustomValidator1_ServerValidate ByVal source As System.Object, ByVal args As Handles CustomValidator1 .ServerValidate Dim sConnectionString As String Dim sqlString As String Dim MyConnection As SqlConnection Dim MyDataAdapter As SqlDataAdapter Dim DS As New DataSet sConnectionString Application strConnect sqlString Select from Customer where CustID ' args.Value...
The CmdDeleteClick Function
The administrator also can delete records by using the Update Delete form. To delete a record, the administrator needs to click on the Delete button in the Update Delete form. When the administrator clicks on the Delete button, the CmdDelete_Click function executes. The CmdDelete_Click function prompts the administrator to confirm the deletion of the selected record. If the administrator clicks on the Yes button in the message box, the selected record is deleted from the database. The code of...
DTD Validation
DTD validation is implemented using the validity constraints defined in the W3C. As previously discussed, DTDs use a formal set of rules to describe the structure and syntax of compliant XML documents. DTDs specify content and values allowed for the XML document. XML documents are associated with and validated against the DTD defined in the lt doctype gt declaration, which can be either an inline DTD or a reference to an external DTD file. For information on inline and external DTDs, you can...
The InputBox Function
As the name suggests, the inputBox function is used to accept input from the user. InputBox Prompt, Title , Default , X , Y Prompt is the prompt or message to be displayed. If the message is more than one line, you can use the carriage return character Chr 13 and the linefeed characters Chr 10 to separate the lines. Title is the text to be displayed in the title bar of the input box. It is optional, and if omitted, the name of the application appears in the title bar. Default is the default...



