asp.net datagrids in dreamweaver 8

In this article you will be able to use the newcorrectly. If an error occurs, check your
features of dreamweaver 8 to connect to a SQLConnection string settings.
database and return the results to a datagrid.Next, click OK to accept the connection settings. You
We will show you how to create full-featured,will now see the Northwind connection appear in the
customized DataGrids using MacromediaDatabases tab of the Applicationpanel group.
Dreamweaver 8 on the ASP.NET application serverLook at web.config in your site's root directory.
platform.Notice that Dreamweaver has added several new
You will set up your Dreamweaver MX site, connectlines under the element:element:
to the database, create the DataSet for theData Source=NameOfYourDatabaseServer;
DataGrid, and create a default DataGrid. InInitial Catalog=Northwind;User ID=sa;Password=;" />
thefollowing three articles, you will build on what youYou will now need to create the DataSet that you
learn in this article and learn how to customize thewill use for the DataGrid data source.
DataGrid appearance, make theUsing the new page you created prior to defining the
DataGrid editable, and sort columns in the DataGrid.database connection, save the page as
By the end of the article, you will be comfortableemployees.aspx
working with DataGrids and will befamiliar with theirIn the Application panel, click the Server Behaviors
various features and attributes.tab.
This article uses the DataSet tag to obtain the dataThe file DreamweaverCtrls.dll must reside in the /bin
from the sample Northwind database included withdirectory under the root of your website. This file is
SQL Server 2000 and display it in arequired by the ASP custom tagsprovided by
DataGrid.Dreamweaver MX. If you haven't already done so,
Firstly you will need to set up your site definition.click the deploy link within the Server Behaviors tab.
Select Site > New Site... from the Menu bar to createThis will copy the
a new site.DreamweaverCtrls.dll file into the appropriate
On the Basic tab, enter the following information,directory.
clicking Next at the bottom of each screen:Next, click the plus button and select DataSet.
Enter a title in the Name field.The DataSet dialog appears. Name the DataSet
Yes, I want to use a server technology. Selectds_list.
ASP.NET C# as the server technology.Select Northwind from the connection pop-up menu.
Edit and test locally, storing your files atSelect dbo.Employees from the Table pop-up menu.
C:Inetpubwwwroot.Select the Selected: radio button from the Columns:
URL to browse to the root of your siteradio button group.
No, do not copy files when I am done editing.The Employees table in the Northwind database
Click Done to create an initial cache of your site.contains 18 columns. For this example, select the
Open the the Site Definition dialog box by choosingfollowing 10 columns only (hold the Ctrl keywhile you
Site > Edit Sites. Select your site's name from the list,select each column):
and click the Edit button.EmployeeID, LastName, FirstName, HireDate,
Set up the testing server to use ASP.NET C# as theAddress, City, Region, PostalCode,
Server Model. Set the Access and other values asCountry, HomePhone
appropriate for your siteSince you don't need to filter the query, set Filter to
Now we need to create a connection to the SQLNone.
database.Since you want to sort alphabetically according to last
Within Dreamweaver, select File > New... from thename, so set Sort to LastName Ascending.
Menu bar to create a new file. On the General tab,Click OK to create the DataSet.
select Dynamic Page for the Category andSave your work.
ASP.NET C# for the Dynamic Page type. Click theNow you have created the connection to the
Create button to create the new page. This step isdatabase and specified the data that you need to be
required because Dreamweaver needs to knowwhatreturned you will need to create a datagrid to display
kind of server technology your pages will use beforethe information in a tabular form.
it can help you in the create a database connectionOpen the Server Behaviors tab of the Application
Open the Databases tab of the Application panelpanel.
group.Select the plus button again, and select DataGrid.
Click the plus button, and select the SQL ServerName your DataGrid dg_list.
Connection option.when the SQL Server ConnectionSelect the ds_list DataSet from the popup list.
dialog box appears, type in the information presentedShow just four Records instead of the default 10
below, and ensure that it matches your database'srecords.
User ID,password, and name.Leave the rest of the attributes at their default
Connection Name: Set this to Northwind.values for now.
Data Source: Set this to the name of your databaseClick OK to create the DataGrid.
server.Save your work.
Initial Catalog: You will be using the Northwind sampleTo see your page in action, view the page in Live
database that comes with Microsoft SQL Server, soData preview (View > Live Data), or press the F12
set this to Northwind.key to preview the page in your browser as shown
User ID: The default user name for Microsoft SQLin the illustration below.
Server that is created at the time of installation isThe column headers are taken from the names of
SA, so set this to SA.the database columns.
Password: The default password for the SA accountNow that you know how to create DataSets and
is blank, so leave this blank.how to create the default display for the DataGrid
Click the Test button in the SQL Server Connectionusing the data in those datasets.
dialog to ensure that you set up your connection