Appendix B. Connectivity

Having a SQL Server but not allowing programs to connect to it is the same as not having a SQL Server at all. Sure, we may log into Management Studio and write queries directly, but the reality is that the vast majority of our users out there never actually see the database directly — they are just using input and reporting screens in some system we've written.

With this in mind, it probably makes sense to figure out how your application is actually going to talk to the database. There are tons of books out there that cover this topic directly (and, outside of a basic connection, it really is a huge topic unto itself), so we're going to stick afew basic methods of connecting and also some information on do's and don'ts of connectivity.

I can't stress enough how these examples are truly the basics. You can make many, many choices and optimizations for connectivity. I'll touch on a few key things about it here and there, but this is mostly just code. I highly recommend taking a look at a connectivity-specific book.

Get Professional SQL Server™ 2005 Programming 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.