|
Crystal Reports XI Release 2 |
|
Configuring a Connection to the Sample Database in the Server Explorer
In this tutorial, you use a GUI approach to generate your DataSet schema: in the main window of Visual Studio, you drag a database table from Server Explorer onto a DataSet window.
Note This process works in Visual Studio .NET 2002 or 2003 and Visual Studio 2005.
Your first step is to configure a database connection in the Server Explorer to the sample database that is provided with Crystal Reports.
To add a connection to the Xtreme sample database in Server Explorer
- From the View menu, click Server Explorer.
- In Server Explorer, right-click Data Connections, and then click Add Connection...
The next steps are different depending on whether you are adding this connection in Visual Studio .NET 2002 or 2003, or in Visual Studio 2005.
- In Visual Studio .NET 2002 or 2003, do the following:
- In the Data Link Properties dialog box, click the Provider tab.
- In the Choose a data provider panel, click .NET Framework Data Provider for OLE DB, and then click the Connection tab.
- In the Select an OleDB provider box, select Microsoft Jet 4.0 OLE DB Provider.
- In Visual Studio 2005, do the following:
Note If this is the first time you have added a connection in Visual Studio 2005 the Change Data Source window will appear. If the Add Connection dialog box appears, click Change...
- In the Change Data Source dialog box, in the Data Provider combo box, select .NET Framework Data Provider for OLEDB.
- In the DataSource list, select Microsoft Access Database File, and then click OK.
- In the Database File Name field, enter the path to the Xtreme sample database.
Note You can copy and paste the path to the Xtreme sample database. To access the path for your version of Crystal Reports, see Location of Xtreme Sample Database.
- Set the User name and Password fields to blank, and then click Test Connection.
- If your test connection is not successful, recheck the path to the Xtreme sample database and ensure that both User name and Password are blank.
- Click OK to close the Test Connection dialog box, and click OK again to close the Connection Properties dialog box.
- In Server Explorer, expand the Access node, and then the Tables node.
- Verify that the Customer table is visible in the Server Explorer.
Continue to Creating a DataSet Schema.
See Also
Tutorial: Connecting to ADO.NET DataSets | Tutorials and Sample Code | Tutorials' Sample Code Directory