Creating Connections


In this chapter, you looked at connections using various data providers. You learned about connection strings and connection string parameters, and you saw how to open and close connections.

You examined different security options for SQL Server and other data sources and also saw how to display information about the connection after it’s established, using the properties of a connection.

You saw how to handle exceptions generated by connection errors and learned to close the connection in the finally block of the exception handler to ensure that the connection is closed in all cases.

Finally, you looked at specific examples of connecting to different data sources, including the following:
  • SQL Server

  • Microsoft Access

  • Oracle

  • DB2

  • MySQL

In the next chapter, you’ll look at ADO.NET commands and see how to use them to access data.


Data Provider Exception Handler Open Connection Reference Item Integrate Security 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Dan Maharry, James Huddleston, Ranga Raghuram, Scott Allen, Syed Fahad Gilani, Jacob Hammer Pedersen, Jon Reid 2005

Personalised recommendations