08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 4 ■ DATA BINDING WITH <strong>ASP</strong>.<strong>NET</strong> 71<br />

(Connection, Comm<strong>and</strong>, etc.) that are written specifically for this database. In addition to<br />

this, there is also an Object Linking <strong>and</strong> Embedding for Databases (OLEDB) provider <strong>and</strong><br />

an Open Database Connectivity (ODBC) provider, which are written to access any database<br />

that provides OLEDB or ODBC databases, respectively. Although these aren’t<br />

optimized for a database such as SQL Server, they will still work. For older versions of<br />

SQL Server that do not support the ADO.<strong>NET</strong> provider (earlier than 7.0), they provide a<br />

viable option.<br />

The built-in set of providers is rounded out with an Oracle provider, which is optimized<br />

for Oracle databases.<br />

The recommendation if you are using Oracle or SQL Server is to use their dedicated<br />

providers, due to the optimization inherent in them. Should this not work, OLEDB is recommended,<br />

<strong>and</strong> then the ODBC provider as a final fallback option.<br />

You are, of course, not limited to these providers, <strong>and</strong> a third-party ecosystem of<br />

providers around databases such as MySQL <strong>and</strong> PostGreSQL has evolved. Take note that<br />

these providers form dependencies that you’ll need to account for when you deploy your<br />

application.<br />

Despite the fact that you use different providers for different databases or versions of<br />

databases, the API has been carefully designed to avoid fragmentation. Each provider is<br />

built upon a st<strong>and</strong>ard set of interfaces that ensure that the method signatures for st<strong>and</strong>ard<br />

operations such as open <strong>and</strong> close are preserved. Because of this, your application<br />

data access code is buffered from change if you switch databases.<br />

We’ll go into ADO.<strong>NET</strong> programming a little later in this chapter, but first, it’s a good<br />

idea to get a copy of SQL Server. If you don’t have one already, the Express edition can be<br />

downloaded from MSDN at http://msdn.microsoft.com/vstudio/express/sql. We’ll explore<br />

this in the next few sections before delving back into ADO.<strong>NET</strong> development to round<br />

out the chapter. Note that if you are using Windows Vista, you should find Service Pack 2<br />

(SP2) for SQL Server Express <strong>and</strong> then download <strong>and</strong> install that. SP2 is available from<br />

the Visual Studio Express download site at http://msdn.microsoft.com/vstudio/express/<br />

sql/register/default.aspx.<br />

SQL Server 2005 Express<br />

If you’ve developed Windows applications before, you may have encountered a “mini”<br />

desktop database called Microsoft SQL Server Desktop Engine 2000 (MSDE). SQL Server<br />

2005 Express edition is the next version of this <strong>and</strong> is free to download, redistribute, <strong>and</strong><br />

embed in your applications. It’s a great way to get familiar with SQL Server because it can<br />

be used with tools such as SQL Server Management Studio, which may be downloaded<br />

<strong>and</strong> installed from the same site as SQL Server Express. This tool is also used in the Enterprise<br />

editions. In this section, you’ll look at downloading, installing, <strong>and</strong> configuring SQL<br />

Server Express for your applications.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!