SlideShare a Scribd company logo
1 of 7
systems lab
Once the Application has started up and you are at the Start
Page, select the create a new project option. When presented
with the New Project window like the one below, be sure that
you have highlighted Console Application under the Templates
window. Now give the new project the name INV_GRAB in the
Name field, and have the location field pointing to the
F:SAI430 folder you have on the F: drive. The diagram below
depicts what your New Project window should look similar to.
Once you have done this, select OK to complete this operation.
You may get a "Microsoft Development Environment" message
box stating that the project location is not a fully trusted .NET
runtime location. You can ignore this and just select OK. You
should now see your new project listed in the
Solution
Explorer window on the upper right hand corner of the editor
window. You are now ready to begin setting up your form.
STEP 2: Setting Up a Database Connection
Back to Top
The first step now is to set up a database connection with
Access and then a data set that can be used to transport the data
from the database to the application to be written to a file. For
the purposes of this lab and your project, you will only need
data from two columns in the ITEMS table of the INVENTORY
database, but we will control that with the code written later.
The following steps will lead you through the process of setting
up the connection.
To begin, you need to add the following three namespaces to the
top of your application code:
using System.IO;
using System.Data;
using System.Data.OleDb;
Since you are going to be not only connecting to a database but
also writing data to a file, you will need all three of these listed.
Now you can set up the connection to your Access database that
you downloaded and put in your folder. The actual connection
string is @"Provider=Microsoft.JET.OLEDB.4.0; data
source=F:inventory.mdb". This is a standard connection string
for MS Access. You will want to precede this with the command
- string conString = so that the finished connection looks like
this.
string conString = @"Provider=Microsoft.JET.OLEDB.4.0; data
source=F:SAI430inventory.mdb";
This is simply defining a string variable named conString and
assigning the connection string to it. We will use this variable
later.
Now we need to define an OleDbConnection that will be used to
connect to the database. To do this you will need to define a
connection variable as a new OleDbConnection and point it to
the connection string defined in the previous step. Your code
should look like the following.
OleDbConnection conn = new OleDbConnection(conString);
Now you can connect and open the database with the following
command entered right below the line above.
conn.Open();
Last, we need to declare a variable that will be used later on.
Although this really has nothing to do with setting up the
database connection, this is as good a place as any to do this.
You need to define a single variable named rowCount as an
integer and initialize it to zero. Your code should look like the
following.
int rowCount = 0;
STEP 3: Setting Up a Data Set
Back to Top
Now you will need to set up a Data Set that will be used to hold
the data that is pulled from the database so that it can be
processed. This dataset will hold all of the records from the
item table. We will use this data to write out our inventory list
to a file.
You will need to create a query string that will be used to get
the data in the "item" table. This will be a simple select
statement that will get all of the data from the table (we will be
specific regarding what is needed later). You will need to define
a string variable for this query string similar to what you did for
the connection string. When finished, your new string should
look like the following:
string selectStr = "SELECT * FROM item";
There is a variable we will need to use later on, so we might as
well define and initialize at this point. The new variable is an
integer data type and needs to be named rowCount. Initialize it
to zero.
Now you need a new OleDbDataAdapter to work with the
dataset. To do this you will need to define an object named
DataAdapter as a new OleDbDataAdapter and then use the
selectStr created above and the connection variable create to
load it. Your code should look like the following:
OleDbDataAdapter DataAdapter = new
OleDbDataAdapter(selectStr, conn);
Now we can define the data set like the following:
DataSet dataSet = new DataSet();
This is a simple definition that we can use along with the
DataAdapter Fill method to fill the data set like the following:
DataAdapter.Fill(dataSet, "item");
We now have one more step that will allow us to define which
columns we want to get data from later on. We need to define a
DataTable object based on the new dataSet. To do this you will
need the following code:
DataTable dataTable = dataSet.Tables[0];
STEP 4: Getting and Writing the Data
Back to Top
So far we have put everything together to get the data from the
database into our program. Now we need to deal with writing
the data out to a file. To do this we will be using the
StreamWriter class and some of its objects.
We must declare a new instance of the StreamWriter so that we
can obtain its methods. At the same time we can also initialize
the new writer to point to where we want the file to be written
to. Your code should look like the following.
StreamWriter sw = new
StreamWriter(@"F:sai430INV_GRB.txt", false);
Now we are ready to set up the processing to loop through our
data set, pull the data we need into a file, and print it out. To
help with this there is a file in Doc Sharing named
Lab1_code.txt. The code in this file can be copied and pasted
into the area of the code section you are working, just below the
line you added above. Be sure to change the directory path to
match yours for the output file.
You are now ready to make your last build. If everything has
been done correctly, you should end up with no error messages
and clean build. Once this has been done then you are ready to
execute the application by selecting Debug => Start from the
main menu. If all goes well you should be able to find your
output file in the location listed in the program.
STEP 5: Building the Application
Back to Top
You are now ready to make your last build, but first you need to
make two changes to the properties for your project.
Changing the build option for 32-bit.
We need to build the application as a 32-bit application so it
will work with the Microsoft ODBC drivers for Access; to do
this you will need to select
Project => INV_GRAB Properties
from the main menu. Now select the Build tab on the side of
the properties box, and then in the drop down list next to
Program Target, select the X86 option. This will allow the
application to build as a 32-bit application. Do not close the
properties window yet though, because there is one more step.
Setting the Security option:
Now select the Security tab on the left side. Check the
Enable ClickOnce Security Settings
check box. This is a full trust application option, which is what
you want.
Now select
File => Save All
from the main menu and then close the properties window.
Now you can either build or re-build the application. If
everything has been done correctly, you should end up with no
error messages and clean build. Once this has been done, you
are ready to execute the application by selecting Debug => Start
from the main menu. If all goes well you should be able to find
your output file in the location listed in the program.
STEP 6: Testing Your Application
Back to Top
You first want to make sure that you have the Inventory.MDB
database in the SAI430 folder on the F: of your directory
structure in Citrix. This should also be the same location of
your source code project and the location to which you have
pointed the program to write the output file. In order to test the
application and generate the output document you will need to
turn in, do the following:
Again, make sure the application, inventory.mdb, and the output
path in the application are all using the SAI430 directory on the
F: drive in Citrix.
Execute your program.
Check to make sure that the output file has the correct data in it.
Submit this file along with your code to be graded

More Related Content

Similar to systems labOnce the Application has started up and you are at the .docx

Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Cathie101
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfmallik3000
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docxamrit47
 
3 tier architecture in asp.net
3 tier architecture in asp.net3 tier architecture in asp.net
3 tier architecture in asp.netRavi Bansal
 
3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdfBOSC Tech Labs
 
How to design a report with fine report reporting tool
How to design a report with  fine report reporting toolHow to design a report with  fine report reporting tool
How to design a report with fine report reporting toolFineReport Reporting Tool
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docxclarebernice
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web MahmoudOHassouna
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Aeric Poon
 
Cis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universityCis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universitylhkslkdh89009
 
OBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation StepsOBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation StepsDharmaraj Borse
 
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Mumbai B.Sc.IT Study
 
Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetFaRid Adwa
 
Uploading customer master extended address using bapi method
Uploading customer master extended address using bapi methodUploading customer master extended address using bapi method
Uploading customer master extended address using bapi methodlondonchris1970
 
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docxLab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docxDIPESH30
 

Similar to systems labOnce the Application has started up and you are at the .docx (20)

Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
 
Ado Presentation
Ado PresentationAdo Presentation
Ado Presentation
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
I am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdfI am having trouble writing the individual files for part 1, which i.pdf
I am having trouble writing the individual files for part 1, which i.pdf
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
3 tier architecture in asp.net
3 tier architecture in asp.net3 tier architecture in asp.net
3 tier architecture in asp.net
 
3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf
 
How to design a report with fine report reporting tool
How to design a report with  fine report reporting toolHow to design a report with  fine report reporting tool
How to design a report with fine report reporting tool
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
 
Linq to sql
Linq to sqlLinq to sql
Linq to sql
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
 
Cis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universityCis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry university
 
OBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation StepsOBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation Steps
 
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
 
Visual Basic.Net & Ado.Net
Visual Basic.Net & Ado.NetVisual Basic.Net & Ado.Net
Visual Basic.Net & Ado.Net
 
Uploading customer master extended address using bapi method
Uploading customer master extended address using bapi methodUploading customer master extended address using bapi method
Uploading customer master extended address using bapi method
 
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docxLab #9 and 10 Web Server ProgrammingCreate a New Folder  I s.docx
Lab #9 and 10 Web Server ProgrammingCreate a New Folder I s.docx
 

More from perryk1

Take a few moments to research the contextual elements surrounding P.docx
Take a few moments to research the contextual elements surrounding P.docxTake a few moments to research the contextual elements surrounding P.docx
Take a few moments to research the contextual elements surrounding P.docxperryk1
 
Table of Contents Section 2 Improving Healthcare Quality from.docx
Table of Contents Section 2 Improving Healthcare Quality from.docxTable of Contents Section 2 Improving Healthcare Quality from.docx
Table of Contents Section 2 Improving Healthcare Quality from.docxperryk1
 
Take a company and build a unique solution not currently offered. Bu.docx
Take a company and build a unique solution not currently offered. Bu.docxTake a company and build a unique solution not currently offered. Bu.docx
Take a company and build a unique solution not currently offered. Bu.docxperryk1
 
Tackling a Crisis Head-onThis week, we will be starting our .docx
Tackling a Crisis Head-onThis week, we will be starting our .docxTackling a Crisis Head-onThis week, we will be starting our .docx
Tackling a Crisis Head-onThis week, we will be starting our .docxperryk1
 
take a look at the latest Presidential Order that relates to str.docx
take a look at the latest Presidential Order that relates to str.docxtake a look at the latest Presidential Order that relates to str.docx
take a look at the latest Presidential Order that relates to str.docxperryk1
 
Table of Contents-Perioperative Care.-Perioperative Med.docx
Table of Contents-Perioperative Care.-Perioperative Med.docxTable of Contents-Perioperative Care.-Perioperative Med.docx
Table of Contents-Perioperative Care.-Perioperative Med.docxperryk1
 
Take a look at the sculptures by Giacometti and Moore in your te.docx
Take a look at the sculptures by Giacometti and Moore in your te.docxTake a look at the sculptures by Giacometti and Moore in your te.docx
Take a look at the sculptures by Giacometti and Moore in your te.docxperryk1
 
Table of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docx
Table of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docxTable of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docx
Table of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docxperryk1
 
Table of Contents Title PageWELCOMETHE VAJRA.docx
Table of Contents Title PageWELCOMETHE VAJRA.docxTable of Contents Title PageWELCOMETHE VAJRA.docx
Table of Contents Title PageWELCOMETHE VAJRA.docxperryk1
 
Take a few minutes to reflect on this course. How has your think.docx
Take a few minutes to reflect on this course. How has your think.docxTake a few minutes to reflect on this course. How has your think.docx
Take a few minutes to reflect on this course. How has your think.docxperryk1
 
Taiwan The Tail That Wags DogsMichael McDevittAsia Po.docx
Taiwan The Tail That Wags DogsMichael McDevittAsia Po.docxTaiwan The Tail That Wags DogsMichael McDevittAsia Po.docx
Taiwan The Tail That Wags DogsMichael McDevittAsia Po.docxperryk1
 
TABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docx
TABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docxTABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docx
TABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docxperryk1
 
Tackling wicked problems A public policy perspective Ple.docx
Tackling wicked problems  A public policy perspective Ple.docxTackling wicked problems  A public policy perspective Ple.docx
Tackling wicked problems A public policy perspective Ple.docxperryk1
 
Tahira Longus Week 2 Discussion PostThe Public Administration.docx
Tahira Longus Week 2 Discussion PostThe Public Administration.docxTahira Longus Week 2 Discussion PostThe Public Administration.docx
Tahira Longus Week 2 Discussion PostThe Public Administration.docxperryk1
 
Tabular and Graphical PresentationsStatistics (exercises).docx
Tabular and Graphical PresentationsStatistics (exercises).docxTabular and Graphical PresentationsStatistics (exercises).docx
Tabular and Graphical PresentationsStatistics (exercises).docxperryk1
 
Table 4-5 CSFs for ERP ImplementationCritical Success Fact.docx
Table 4-5 CSFs for ERP ImplementationCritical Success Fact.docxTable 4-5 CSFs for ERP ImplementationCritical Success Fact.docx
Table 4-5 CSFs for ERP ImplementationCritical Success Fact.docxperryk1
 
Table 7.7 Comparative Financial Statistics Universal Office Fur.docx
Table 7.7 Comparative Financial Statistics Universal Office Fur.docxTable 7.7 Comparative Financial Statistics Universal Office Fur.docx
Table 7.7 Comparative Financial Statistics Universal Office Fur.docxperryk1
 
TableOfContentsTable of contents with hyperlinks for this document.docx
TableOfContentsTable of contents with hyperlinks for this document.docxTableOfContentsTable of contents with hyperlinks for this document.docx
TableOfContentsTable of contents with hyperlinks for this document.docxperryk1
 
Tajfel and Turner (in chapter two of our reader) give us the followi.docx
Tajfel and Turner (in chapter two of our reader) give us the followi.docxTajfel and Turner (in chapter two of our reader) give us the followi.docx
Tajfel and Turner (in chapter two of our reader) give us the followi.docxperryk1
 
tabOccupational Safety & Health for Technologists, Enginee.docx
tabOccupational Safety & Health for Technologists, Enginee.docxtabOccupational Safety & Health for Technologists, Enginee.docx
tabOccupational Safety & Health for Technologists, Enginee.docxperryk1
 

More from perryk1 (20)

Take a few moments to research the contextual elements surrounding P.docx
Take a few moments to research the contextual elements surrounding P.docxTake a few moments to research the contextual elements surrounding P.docx
Take a few moments to research the contextual elements surrounding P.docx
 
Table of Contents Section 2 Improving Healthcare Quality from.docx
Table of Contents Section 2 Improving Healthcare Quality from.docxTable of Contents Section 2 Improving Healthcare Quality from.docx
Table of Contents Section 2 Improving Healthcare Quality from.docx
 
Take a company and build a unique solution not currently offered. Bu.docx
Take a company and build a unique solution not currently offered. Bu.docxTake a company and build a unique solution not currently offered. Bu.docx
Take a company and build a unique solution not currently offered. Bu.docx
 
Tackling a Crisis Head-onThis week, we will be starting our .docx
Tackling a Crisis Head-onThis week, we will be starting our .docxTackling a Crisis Head-onThis week, we will be starting our .docx
Tackling a Crisis Head-onThis week, we will be starting our .docx
 
take a look at the latest Presidential Order that relates to str.docx
take a look at the latest Presidential Order that relates to str.docxtake a look at the latest Presidential Order that relates to str.docx
take a look at the latest Presidential Order that relates to str.docx
 
Table of Contents-Perioperative Care.-Perioperative Med.docx
Table of Contents-Perioperative Care.-Perioperative Med.docxTable of Contents-Perioperative Care.-Perioperative Med.docx
Table of Contents-Perioperative Care.-Perioperative Med.docx
 
Take a look at the sculptures by Giacometti and Moore in your te.docx
Take a look at the sculptures by Giacometti and Moore in your te.docxTake a look at the sculptures by Giacometti and Moore in your te.docx
Take a look at the sculptures by Giacometti and Moore in your te.docx
 
Table of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docx
Table of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docxTable of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docx
Table of ContentsLOCAL PEOPLE PERCEPTION TOWARDS SUSTAINABLE TOU.docx
 
Table of Contents Title PageWELCOMETHE VAJRA.docx
Table of Contents Title PageWELCOMETHE VAJRA.docxTable of Contents Title PageWELCOMETHE VAJRA.docx
Table of Contents Title PageWELCOMETHE VAJRA.docx
 
Take a few minutes to reflect on this course. How has your think.docx
Take a few minutes to reflect on this course. How has your think.docxTake a few minutes to reflect on this course. How has your think.docx
Take a few minutes to reflect on this course. How has your think.docx
 
Taiwan The Tail That Wags DogsMichael McDevittAsia Po.docx
Taiwan The Tail That Wags DogsMichael McDevittAsia Po.docxTaiwan The Tail That Wags DogsMichael McDevittAsia Po.docx
Taiwan The Tail That Wags DogsMichael McDevittAsia Po.docx
 
TABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docx
TABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docxTABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docx
TABLE 1-1 Milestones of Medicine and Medical Education 1700–2015 ■.docx
 
Tackling wicked problems A public policy perspective Ple.docx
Tackling wicked problems  A public policy perspective Ple.docxTackling wicked problems  A public policy perspective Ple.docx
Tackling wicked problems A public policy perspective Ple.docx
 
Tahira Longus Week 2 Discussion PostThe Public Administration.docx
Tahira Longus Week 2 Discussion PostThe Public Administration.docxTahira Longus Week 2 Discussion PostThe Public Administration.docx
Tahira Longus Week 2 Discussion PostThe Public Administration.docx
 
Tabular and Graphical PresentationsStatistics (exercises).docx
Tabular and Graphical PresentationsStatistics (exercises).docxTabular and Graphical PresentationsStatistics (exercises).docx
Tabular and Graphical PresentationsStatistics (exercises).docx
 
Table 4-5 CSFs for ERP ImplementationCritical Success Fact.docx
Table 4-5 CSFs for ERP ImplementationCritical Success Fact.docxTable 4-5 CSFs for ERP ImplementationCritical Success Fact.docx
Table 4-5 CSFs for ERP ImplementationCritical Success Fact.docx
 
Table 7.7 Comparative Financial Statistics Universal Office Fur.docx
Table 7.7 Comparative Financial Statistics Universal Office Fur.docxTable 7.7 Comparative Financial Statistics Universal Office Fur.docx
Table 7.7 Comparative Financial Statistics Universal Office Fur.docx
 
TableOfContentsTable of contents with hyperlinks for this document.docx
TableOfContentsTable of contents with hyperlinks for this document.docxTableOfContentsTable of contents with hyperlinks for this document.docx
TableOfContentsTable of contents with hyperlinks for this document.docx
 
Tajfel and Turner (in chapter two of our reader) give us the followi.docx
Tajfel and Turner (in chapter two of our reader) give us the followi.docxTajfel and Turner (in chapter two of our reader) give us the followi.docx
Tajfel and Turner (in chapter two of our reader) give us the followi.docx
 
tabOccupational Safety & Health for Technologists, Enginee.docx
tabOccupational Safety & Health for Technologists, Enginee.docxtabOccupational Safety & Health for Technologists, Enginee.docx
tabOccupational Safety & Health for Technologists, Enginee.docx
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

systems labOnce the Application has started up and you are at the .docx

  • 1. systems lab Once the Application has started up and you are at the Start Page, select the create a new project option. When presented with the New Project window like the one below, be sure that you have highlighted Console Application under the Templates window. Now give the new project the name INV_GRAB in the Name field, and have the location field pointing to the F:SAI430 folder you have on the F: drive. The diagram below depicts what your New Project window should look similar to. Once you have done this, select OK to complete this operation. You may get a "Microsoft Development Environment" message box stating that the project location is not a fully trusted .NET runtime location. You can ignore this and just select OK. You should now see your new project listed in the Solution Explorer window on the upper right hand corner of the editor window. You are now ready to begin setting up your form. STEP 2: Setting Up a Database Connection Back to Top The first step now is to set up a database connection with Access and then a data set that can be used to transport the data from the database to the application to be written to a file. For the purposes of this lab and your project, you will only need data from two columns in the ITEMS table of the INVENTORY database, but we will control that with the code written later. The following steps will lead you through the process of setting
  • 2. up the connection. To begin, you need to add the following three namespaces to the top of your application code: using System.IO; using System.Data; using System.Data.OleDb; Since you are going to be not only connecting to a database but also writing data to a file, you will need all three of these listed. Now you can set up the connection to your Access database that you downloaded and put in your folder. The actual connection string is @"Provider=Microsoft.JET.OLEDB.4.0; data source=F:inventory.mdb". This is a standard connection string for MS Access. You will want to precede this with the command - string conString = so that the finished connection looks like this. string conString = @"Provider=Microsoft.JET.OLEDB.4.0; data source=F:SAI430inventory.mdb"; This is simply defining a string variable named conString and assigning the connection string to it. We will use this variable later. Now we need to define an OleDbConnection that will be used to connect to the database. To do this you will need to define a connection variable as a new OleDbConnection and point it to the connection string defined in the previous step. Your code should look like the following.
  • 3. OleDbConnection conn = new OleDbConnection(conString); Now you can connect and open the database with the following command entered right below the line above. conn.Open(); Last, we need to declare a variable that will be used later on. Although this really has nothing to do with setting up the database connection, this is as good a place as any to do this. You need to define a single variable named rowCount as an integer and initialize it to zero. Your code should look like the following. int rowCount = 0; STEP 3: Setting Up a Data Set Back to Top Now you will need to set up a Data Set that will be used to hold the data that is pulled from the database so that it can be processed. This dataset will hold all of the records from the item table. We will use this data to write out our inventory list to a file. You will need to create a query string that will be used to get the data in the "item" table. This will be a simple select statement that will get all of the data from the table (we will be specific regarding what is needed later). You will need to define a string variable for this query string similar to what you did for the connection string. When finished, your new string should look like the following:
  • 4. string selectStr = "SELECT * FROM item"; There is a variable we will need to use later on, so we might as well define and initialize at this point. The new variable is an integer data type and needs to be named rowCount. Initialize it to zero. Now you need a new OleDbDataAdapter to work with the dataset. To do this you will need to define an object named DataAdapter as a new OleDbDataAdapter and then use the selectStr created above and the connection variable create to load it. Your code should look like the following: OleDbDataAdapter DataAdapter = new OleDbDataAdapter(selectStr, conn); Now we can define the data set like the following: DataSet dataSet = new DataSet(); This is a simple definition that we can use along with the DataAdapter Fill method to fill the data set like the following: DataAdapter.Fill(dataSet, "item"); We now have one more step that will allow us to define which columns we want to get data from later on. We need to define a DataTable object based on the new dataSet. To do this you will need the following code: DataTable dataTable = dataSet.Tables[0]; STEP 4: Getting and Writing the Data Back to Top So far we have put everything together to get the data from the
  • 5. database into our program. Now we need to deal with writing the data out to a file. To do this we will be using the StreamWriter class and some of its objects. We must declare a new instance of the StreamWriter so that we can obtain its methods. At the same time we can also initialize the new writer to point to where we want the file to be written to. Your code should look like the following. StreamWriter sw = new StreamWriter(@"F:sai430INV_GRB.txt", false); Now we are ready to set up the processing to loop through our data set, pull the data we need into a file, and print it out. To help with this there is a file in Doc Sharing named Lab1_code.txt. The code in this file can be copied and pasted into the area of the code section you are working, just below the line you added above. Be sure to change the directory path to match yours for the output file. You are now ready to make your last build. If everything has been done correctly, you should end up with no error messages and clean build. Once this has been done then you are ready to execute the application by selecting Debug => Start from the main menu. If all goes well you should be able to find your output file in the location listed in the program. STEP 5: Building the Application Back to Top You are now ready to make your last build, but first you need to
  • 6. make two changes to the properties for your project. Changing the build option for 32-bit. We need to build the application as a 32-bit application so it will work with the Microsoft ODBC drivers for Access; to do this you will need to select Project => INV_GRAB Properties from the main menu. Now select the Build tab on the side of the properties box, and then in the drop down list next to Program Target, select the X86 option. This will allow the application to build as a 32-bit application. Do not close the properties window yet though, because there is one more step. Setting the Security option: Now select the Security tab on the left side. Check the Enable ClickOnce Security Settings check box. This is a full trust application option, which is what you want. Now select File => Save All from the main menu and then close the properties window. Now you can either build or re-build the application. If everything has been done correctly, you should end up with no error messages and clean build. Once this has been done, you are ready to execute the application by selecting Debug => Start from the main menu. If all goes well you should be able to find your output file in the location listed in the program.
  • 7. STEP 6: Testing Your Application Back to Top You first want to make sure that you have the Inventory.MDB database in the SAI430 folder on the F: of your directory structure in Citrix. This should also be the same location of your source code project and the location to which you have pointed the program to write the output file. In order to test the application and generate the output document you will need to turn in, do the following: Again, make sure the application, inventory.mdb, and the output path in the application are all using the SAI430 directory on the F: drive in Citrix. Execute your program. Check to make sure that the output file has the correct data in it. Submit this file along with your code to be graded