This walkthrough shows you how to add new data using AccessDataSource control, where one of the columns data type is AutoNumber.
During this walkthrough, you will learn how to do the following:
- Use AccessDataSource.
- Use SmartTag to set DataSource.
- Use Data Source Configuration Wizard to set the Database and table.
- Add new data without having to specify the ProductID.
Prerequisites
In order to complete this walkthrough, you will need the following:
- Access to the Microsoft Access Northwind database.
- Visual Studio 2005 Application.
Step-By-Step Instructions
To create new web application and add new data into the WebGrid
- Binding WebGrid to AccesDataSource control. (Use Products table)
- Right click on WebGrid instance and choose WebGrid.NET Designer.
- In WebGrid.NET Designer - Quick Start - Popular Settings, tick Allow Add New.
- Save and run the project.
- Click on the NewRow section and add all the information needed but leave ProductID column blank/empty.
- Press Shift + Enter to add the new row. Notice that the ProductID will be set as auto-increment according to the previous one.
Other Resources
Walkthrough Topics
How-to Topics