Web Form Pages: Table of Contents
Web Form Pages: Table of Contents
After starting Haystack you will need to add a new Project. A project is used to
generate all objects from a SQL Server or Oracle database.
3-2
You will now be presented with the Project Information screen. On this screen
is where you will create the project that points to a database.
All you need to create a project is on this first tab (Figure 3). For this quick start,
just fill in a connection string to one of your databases, or if you installed the
Haystack Code Generator for .NET
Copyright 2010-2011 by PDSA, Inc.
All rights reserved. Reproduction is strictly prohibited.
3-3
After clicking the Load Tables/Apply Filter button the grid on the lower part of
the screen will be filled in with the names of the tables that match the filter.
At this point you need to click on the Info button to the left of a table to load all
of the columns for the table and display the Table Information Screen (Figure
5). You must open the table to load all columns in order to generate classes for
a table.
3-5
You may then click on the Open Gen Folder button to view the classes that
have been generated.
3-6
3-7
3-8
Your Solution Explorer window in your Web application should now look like the
Figure 9:
3-9
You now need to add some resources to your ASP.NET web application in
order for the generated code to work.
From Haystack, click the Open | Install Folder for Resources menu as shown
in Figure 10.
Figure 10: Your Visual Studio project after adding generated code
3-10
Now back in your Visual Studio web application right mouse click and choose
Add Reference from the context menu.
Click the Browse tab.
Navigate to the folder where you installed Haystack which is typically
C:\Program Files\Haystack or C:\Program Files (x86)\Haystack and under the
folder named \_Resources-For-ASP.NET-WebForms select all of the DLLs that
you find there and click the OK button as shown in Figure 12.
3-11
Now within the \Views folder in your Visual Studio project, find one of the
generate views, right mouse click on and select Set As Start Page. Press F5 to
run the application and your new view should appear.
NOTE:
Congratulations! You created a complete List, Search, Add, Edit and Delete
page in just a matter of minutes.
3-12
Summary
In this chapter you learned how to quickly generate CRUD classes and put
those classes into an ASP.NET project and test out the generated classes and
Web Form Pages.
NOTE:
3-13
Chapter Index
A
Add New Project, 3-2
G
Generate Button, 3-5
Generate CRUD Classes for Tables, 3-4
Generate Table Data Classes, 3-5
I
Info Button, 3-4
L
Load Tables/Apply Filter Button, 3-4
Q
Quick Start for ASP.NET Web Form
Applications, 3-1
S
Save Table Info Button, 3-5
T
Table Information Screen, 3-4
Test Generated Classes and Web Form
Pages, 3-7
Tutorial for ASP.NET Web Form
Applications, 3-1
O
Open Gen Folder Button, 3-6
3-14