4 Using the Data Providers in Visual Studio : Using Provider-specific Templates

Using Provider-specific Templates
Visual Studio offers a set of templates to help you build applications that automatically include DataDirect features such as SQL leveling.
Creating a New Project
When you create a new project in Visual Studio, you can use a template specific to DataDirect Connect for ADO.NET data provider, or a template that creates an application with generic code.
In the following example, we create a new project in Visual Studio using the template for DataDirect Connect for ADO.NET Oracle data provider.
To create a new project:
1
Select File / New / Project... The New Project dialog box appears.
2
In the Project Types pane, select Visual C# / Progress DataDirect.
New Project dialog, with the DataDirect Oracle Project template seleted
3
a
In the Templates pane, select Progress DataDirect Oracle Project.
b
In the Name field, type a name, for example, My DataDirect Oracle Project, or accept the default name.
c
In the Location field, type the location to which you want to save the project, or click Browse to navigate to the directory.
d
In the Solution Name field, type the name for the solution.
e
4
The new project appears in the Solution Explorer. The namespace for the Oracle data provider is automatically added to the project.
Solution Explorer with a DataDirect Oracle Provider project
NOTE: If you are using the ADO.NET common programming model, select the Progress DataDirect Generic Provider Project template. In this case, the project does not require a specific reference to an assembly.
Solution Explorer with a Progress DataDirect Generic Provider project
Adding a Template to an Existing Project
1
In Solution Explorer, right-click the project and select Add / New Item.... The Add New Item dialog box appears.
Add New Item dialog showing available Visual Studio installed templates.
2
3
Click Add. The class for the DataDirect data provider, in this example, the Progress DataDirect Oracle data provider, is added to a project created with the Progress DataDirect Generic template.
Solution Explorer, showing the Progress DataDirect Oracle class in the Progress DataDirect Generic project..