Virtually all ASP.NET applications of interest work with database data at some level, and one of the most common databases used in ASP.NET applications is Microsoft's own SQL Server database. With relational databases like SQL, commands are issued through the SQL syntax, which includes SELECT, INSERT, UPDATE, and DELETE statements, among others. One way to issue a command to a database from an ASP.NET application is to craft the SQL query in the application itself. Such queries are often called ad-hoc queries. The primary downside of ad-hoc queries is that they are hard to maintain - if you need to change your query you need to edit the string in your application, recompile, and redeploy.
The article continues at http://aspnet.4guysfromrolla.com/articles/062905-1.aspx