O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Parameters and Stored Procedures

We have covered the basics of using ADO.NET in a connected scenario. We have seen that by using the appropriate interfaces, we can write database code that is relatively independent of the data source. We are now going to begin to examine some additional features, where there may be differences among data sources. For example, we will look at the use of stored procedures. For the rest of this chapter we will focus on the SQL Server database.

Sometimes you have to parameterize a SQL statement. You also might have to associate the input and output arguments of a stored procedure with variables in your program.

To do this you build the SqlCommand class's Parameters property, which is a collection of SqlParameter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required