Connecting to your database in a Web application is similar to connecting to your database in Windows applications. You still use an instance of the Connection class for your .NET Data Provider to manage the connection to your database. However, there are some slight differences to keep in mind when connecting in a Web application.
Throughout this text, we’ve used trusted connections to connect to the local SQL Express installation on your development machine:
Data Source=.\SQLExpress; Initial Catalog=Northwind;Integrated Security=True;
You can use this same connection string at design time in a Web application, but you might encounter problems using this connection string at run time. ...