ASP.NET binding with OpenAccessDataSource

Posted by: the telerik blogs, on 15 Nov 2008 | View original | Bookmarked: 0 time(s)

In the last post we saw how easy it is to reverse engineer a database schema. Let's now use the resulting persistent classes library to build the first website.

Let's do it again step by step:

Step 1: Use the resulting solution from the northwind reverse engineeringpost.

Step 2: Add a new web applicationby execution File->Add->New Web Site... from the Visual Studio Menu. Choose ASP.NET Web Site.

Step 3: Adda reference from the website to the class library. Select the website project in the Solution Explorer and execute Website->Add reference from the Visual Studio Menu. Select the class library project in the Projects tab.

All OpenAccess binding controls can open and manage the database by themselves. They only need a helper class that holds the code for database access. This class can be generated from the OpenAccess Enable Project Wizard. You can place this class directly in the persistent classes library or in a separate Data Access Layer assembly.

Step 4:Add the OpenAccess helper class to the persistent classes library. Select the class library project in the Solution Explorer and execute OpenAccess->Enable Project. Keep everything as it is, only on the second page check the 'Data Access code' checkbox.

Enable Project page 2 data access code

Step 5: Compile everything so that the web page designers can work.

Now you have a perfect project for designing some ASP.NET pages as you are always doing.

Step 6: Drag and drop the gridof your choiceto the default.aspx file. Open the controls context menu. Select '<New data source>' from the controls 'Choose Data Source' combobox. Choose the OpenAccessDataSource which starts the wizard.

Dialog 1: Choose the helper classyou did generate and press Next.

Data source wizard page 1

Dialog 2: Select the type that you want to bind to the grid. In our case let's choose Order. And press Finish

Data source wizard page 2

Step 7: We are done and you can start your application.

You can now start to design your web pages as you always do.

Jan

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 827 | Hits: 5

Similar Posts

  • Entirely unobtrusive and imperative templates with Microsoft Ajax Library Preview 6 more
  • Silverlight, MVVM, Prism and More at VSLive Orlando more
  • Web Deployment Tool has gone RTW more
  • ASP.NET AJAX 4.0 Preview 5 released to CodePlex more
  • 5 Minute Overview of MVVM in Silverlight more
  • Client Configuration in WCF 4.0 more
  • Simplistic Object Copying in .NET more
  • Whats New In Silverlight 3 - Validation more
  • System.Data.Linq.Binary is not XmlSerializable more
  • A (less) simple include for ASP.NET more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD