success error

Form Is Invalid!

Buy Guided BIS311 Lab 7

Buy Guided BIS311 Lab 7

 

Lab 7 of 7: Two-Tier Applications (40 Points)
Submit your assignment to the Dropbox located on the silver tab at the top of this page.
(See Syllabus “Due Dates for Assignments & Exams” for due dates.)
L A B O V E R V I E W
Scenario and Summary
In this exercise, you will create a two-tier application that retrieves a password from an Access database called LoginData.mdb. This database contains a table called LoginData, which has the following structure and data.
Structure
Data
The user-services layer (a Windows form) will look like the following.
When the user presses the Retrieve Password button, the button_click event fires. This event instantiates a DataServices class. DataServices receives the username from the user and either sends back the password or a “not found” message indicating that the username isn’t in the database.
The result if UserName is found
The result if UserName is not Found
Deliverables
Section
Deliverable
Points
Step 13
Lab7YourFirstLastName.docx (Word document) Screenshot of Windows form Screenshot of DataService class code Screenshot of button_click event code
40
Category
Points
%
Verify project configuration.
5
12.5%
Make all the files visible.
3
7.5%
Move the Logindata.mdb file.
5
12.5%
Add a database to a project.
8
20%
Design and code a DataService class.
8
20%
Design Form1.vb and set the properties as instructed.
5
12.5%
Code the button-click event.
3
7.5%
Test the application.
3
7.5%
Total
40
100%
L A B S T E P S
Preparation
1. Go to Doc Sharing and get the database called LoginData.mdb. Store it in the root directory of the computer that you’re working on. Use the root directory of your computer’s C: drive or the root directory of your USB drive. By the root directory, we mean the top-level folder on your machine, called C: for the C: drive (or something like that) or E: for the USB drive (the drive letter may vary for the USB drive). TIP: Don’t put the LoginData.mdb file on your desktop or in a folder somewhere; put it in the root directory of C: drive or your USB drive. This will make it easier to access from within Visual Studio later.
2. Log onto the Citrix server and launch Visual Studio 2010.
L A B S T E P S
STEP 1
Start a new Visual Basic Windows Forms Application Project and name it Lab7YourFirstLastName. (If needed, please refer to Lab 4, Step 2 for detailed instructions.)
L A B S T E P S
STEP 2
We need to verify what the configuration of the project is so that the compiler will generate only 32-bit (and not 64-bit) code. This is a technical detail that is necessary because we will be working with a Microsoft Access database, and only 32-bit driver software is available for this database. To do this, go to Build > Configuration Manager.
In the Configuration Manager’s “Active solution platform” dialog, it should say x86. If it does, then the configuration is fine. If not, then click on the drop-down list under the “Active solution platform” and select.
Under “Type or select the new platform,” change what is currently there to x86 and click OK.
Click Close to close the Configuration Manager.
L A B S T E P S
STEP 3
Go to Solution Explorer and make all the files and folders in your project visible. Do this by clicking on the Show All Files icon. This icon has a blue border around it in the diagram below, and it has a group of files and folders superimposed on each other.
After pressing the button, your Solution Explorer should look similar to the following.
L A B S T E P S
STEP 4
Click on the plus sign to the left of the bin folder. The bin folder will expand to show the Debug folder. Click on its plus sign to show its files. You will place your Logindata.mdb database in this Debug folder. The database must be in this folder for your application to work properly. Your Solution Explorer should look similar to this.
If there happen to be more files, or even another folder, within the Debug folder than what is in the screenshot, it is fine.
L A B S T E P S
STEP 5
Put your mouse on the Debug folder and right-click it. Select “Include in Project.” Then, right-click on the same folder a second time and select “Add > Existing Item.” Browse to the location on your local computer where you downloaded the Logindata.mdb database earlier (the C$ on ‘Client’ if you used your C: drive or the drive letter of your USB drive followed by $ if you used your USB drive). Also, click on the drop-down arrow in the drop-down list beside the File name box and select “All Files” (*.). (If you don’t do this, you won’t be able to see your database.) You should see something like the following.
L A B S T E P S
STEP 6
Now, let’s put the database in the Debug folder. Select LoginData and then click the Add button. If the Data Source Configuration Wizard dialog appears, click Cancel.
Your Solution Explorer should now look similar to this, with a copy of the login data database in the binDebug folder.
L A B S T E P S
STEP 7
Now, you can design your data-services class. Go to Project > Add Class, and add a class named DataService (refer to your previous iLabs if you need a reminder of how to add a class). Your complete Solution Explorer should look like this.
L A B S T E P S
STEP 8
If it is not already open, open up the DataService class by double-clicking on it. Place the following code in it, along with your name in a comment at the top.
Your biggest challenge will likely be typing in the connection string, which contains the provider, the path to the database, and the name of the database. This must be typed exactly as shown in the screenshot. If this level of detail causes difficulty, you can just cut and paste the following connection string into the class (after typing in.ConnectionString = ).
“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|LoginData.mdb;”
L A B S T E P S
STEP 9
In the Solution Explorer, double-click on the form Form1.vb so that you can design it. From the Toolbox, drag two Labels (a Textbox and a Button) onto the form, and arrange them as follows.
L A B S T E P S
STEP 10
Set the following properties for the controls on the form.
Control
Property
Setting
Form1.vb
Text
Lab7YourFirstLastName
Label1
Text
Enter User Name
Textbox1
Name
txtUserName
Button1
Text
Retrieve Password
Label2
Name
lblResult
lblResult (was Label2)
Text
Search Results Display Here
Make sure your completed form looks like this.
L A B S T E P S
STEP 11
Double-click the Button to go to the button_click event, and type this code (make sure you put the name of the lab and your name in a comment at the top, as shown).
L A B S T E P S
STEP 12
Test the application by pressing the Start Debugging button. Try entering the username abc, and make sure the program returns the value 123. Try entering an invalid username, such as
funky monkey, or leaving the username column blank. The program should display error messages in these cases.
L A B S T E P S
STEP 13
Create a Word document called Lab7YourFirstLastName.docx and paste a screenshot of your form, the DataService class code, and your button_click event code. Make sure that your name is in the text property of the form and a comment at the top of each DataService class. Submit your Word document containing these three screenshots to the Week 7 Dropbox.
Congratulations! You’ve written a two-tier application.

Need to Purchase Labs?

Are your assessments throughout the corner? Are you thinking, I need someone to take my online exam? Do you want someone to help you out in the ones dire times of yours? Welcome to Get Exam Done. We are an academic help issuer that connects professional academics to struggling university college students. We help university college students with their online assessments with the useful resource of usage of assisting them hands-on at some stage in the exam. It does now no longer depend on what your issue is, we have got were given specialists in all of them. So, come aboard! Let’s cope with your take my exam online worries. We are available 24/7. You can call us anytime, speak about your online exam problems, and get solutions.

Placeholder $3.99
Buy Guided BIS311 Lab 7
  • 200+ Downloads
  • 8k Views