Connecting to the Database

You can start working with ADO.NET by creating a new .NET project. First, launch Visual Studio.NET. Then, select “New Project” on the start screen. Choose “Visual C# Projects” for the project type, and “ASP.NET Web Application” for the template. Name the project “ado_net_by_example”, and click “Ok”. At this point, Visual Studio will create the initial project structure. Select the Project, Add Web Form menu command, and name the web form SqlCommand.aspx. Add a Label control to the Web Form by double-clicking the Label icon in the toolbox. In the Solution Explorer, right-click on SqlCommand.aspx, and select “View Code”. You are now in the position to start writing ADO.NET code.

The first step in working with the database ...

Get ASP.NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.