There are two steps that must follow for database connectivity in asp.
1. Create a connection string to open a connection.
connection string="Server=servername; databasename=name of database;
username=name of the user; password= password of th e user" selectcommand="select * from xyz " >
2. Pass the Sqldatasource ID (sqldatasource1) into the Control which you want to bound to database.