Entry
Delphi: v8: ASP.NET: Database: Microsoft SQL Server: Northwind: How to create connection?
May 24th, 2004 16:21
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 25 May 2004 - 00:19 am ------------------------
Delphi: v8: ASP.NET: Database: Microsoft SQL Server: Northwind: How to
create connection?
---
Steps: Overview:
1. -Start Delphi v8
2. -Create a new application (e.g. for an ASP.NET web application)
3. -Open the connection to the Microsoft SQL server Northwind database
4. -Drag and drop one of the tables (e.g. Employees) of Northwind on
the form
(that will automatically create the correct needed connection
strings)
1. Click on 'BdpDataAdapter1'
1. Click on link 'Configure Data Adapter'
1. -select tab 'DataSet'
1. -enable checkbox 'New DataSet'
1. accept 'dataSet1'
1. -click button 'OK'
2. Set property 'Live Data->Active' to 'True'
5. -Put a datasource (=DBDataSource) on the form
1. Set the property 'DataSource' to 'dataSet1'
6. -Put a datagrid (=DBWebGrid) on the form
1. Set the property 'DBDataSource' to 'DBWEbDataSource1'
2. Set the property 'TableName' to your Northwind tablename
(so here in this example choose 'Employees')
1. You should now immediately see that your table in that grid
is filled with the table data (here from 'Employees')
1. If you compile your application (press green '>' or F9)
at this point (make sure your Microsoft Internet
Information Server (IIS)
is running), you should see a html page, e.g. with URL
http://localhost/WebApplicationxx/webform1.aspx
but I got the error
'Control 'DBWebGrid2__ctl3__ctl0' of type 'TextBox' must
be placed inside a form tag with runat=server'
Delphi: v8: Control DBWebGrid of type TextBox must be placed inside
form tag with runat=server
http://www.faqts.com/knowledge_base/view.phtml/aid/30039/fid/175
2. After I manually added '<form runat="server"> ... </form>
I saw the table correctly in my HTML page
--- cut here ---------------------------------------------------------
EmployeeID LastName FirstName Title TitleOfCourtesy BirthDate HireDate
Address City Region PostalCode Country HomePhone Extension ReportsTo
PhotoPath
2 Fuller Andrew Vice President, Sales Dr. 2/19/1952 12:00:00 AM
8/14/1992 12:00:00 AM 908 W. Capital Way Tacoma WA 98401 USA (206)
555-9482 3457 http://accweb/emmployees/fuller.bmp
3 Leverling Janet Sales Representative Ms. 8/30/1963 12:00:00 AM
4/1/1992 12:00:00 AM 722 Moss Bay Blvd. Kirkland WA 98033 USA (206)
555-3412 3355 2 http://accweb/emmployees/leverling.bmp
4 Peacock Margaret Sales Representative Mrs. 9/19/1937 12:00:00 AM
5/3/1993 12:00:00 AM 4110 Old Redmond Rd. Redmond WA 98052 USA (206)
555-8122 5176 2 http://accweb/emmployees/peacock.bmp
5 Buchanan Steven Sales Manager Mr. 3/4/1955 12:00:00 AM 10/17/1993
12:00:00 AM 14 Garrett Hill London SW1 8JR UK (71) 555-4848 3453 2
http://accweb/emmployees/buchanan.bmp
6 Suyama Michael Sales Representative Mr. 7/2/1963 12:00:00 AM
10/17/1993 12:00:00 AM Coventry House Miner Rd. London EC2 7JR UK
(71) 555-7773 428 5 http://accweb/emmployees/davolio.bmp
7 King Robert Sales Representative Mr. 5/29/1960 12:00:00 AM 1/2/1994
12:00:00 AM Edgeham Hollow Winchester Way London RG1 9SP UK (71)
555-5598 465 5 http://accweb/emmployees/davolio.bmp
8 Callahan Laura Inside Sales Coordinator Ms. 1/9/1958 12:00:00 AM
3/5/1994 12:00:00 AM 4726 - 11th Ave. N.E. Seattle WA 98105 USA (206)
555-1189 2344 2 http://accweb/emmployees/davolio.bmp
9 Dodsworth Anne Sales Representative Ms. 1/27/1966 12:00:00 AM
11/15/1994 12:00:00 AM 7 Houndstooth Rd. London WG2 7LT UK (71)
555-4444 452 5 http://accweb/emmployees/davolio.bmp
< >
--- cut here ---------------------------------------------------------
7. You can now further put e.g. a navigator and image on the
form, as shown in the video
---
---
Help: see also:
[help: program: Delphi v8->Welcome page->link 'How to'-
>link 'Databases': search for 'Modifying Database Connections']
---
Internet: see also:
---
Delphi: v8 for Microsoft .NET: How to build database in ASP.NET with
Delphi v8? [video]
http://www.faqts.com/knowledge_base/view.phtml/aid/28856/fid/175
---
Delphi: v8: Database: Microsoft SQL Server: Northwind: Overview: Can
you give an overview?
http://www.faqts.com/knowledge_base/view.phtml/aid/30029/fid/175
----------------------------------------------------------------------