Data Access: Create a Database

This application shows you how to execute SQL statements from code using ADO .NET.

Featured Highlights:

This application creates a database, a table, a stored procedure, and a view. SQL
statements are then executed that populate the table with data from the Northwind
database. This table is then queried to fill a DataSet which is subsequently bound
to a DataGrid for display.

Table and column style objects are used to affect the appearance of the DataGrid.

Requirements:

Microsoft Visual Studio.NET Professional or greater.
Windows 2000 or Windows XP.

Running the Sample:

Simply Press F5.

If you want to re-run the application after creating the database, you will need
to close any applications that maintain an active connection to the SQL Server
instance containing the demo database. In most cases, this means you will only have
to close and reopen Visual Studio .NET, but then only if you opened a connection to
the database in the Server Explorer. Other applications, like SQL Query Analyzer,
may also hold an open connection. Alternatively, you can stop and restart the SQL
Server instance using the SQL Server Service Manager in your system tray.

See also

ADO.NET  ADO to ADO.NET