Input, Output, InputOutput are three primary kinds of parameters - ADO.NET

Q.  What are the three primary kinds of parameters?
- Published on 19 Oct 15

a. Input, Integer, String
b. Integer, String, DateTime
c. int, varchar, nvarchar
d. Input, Output, InputOutput

ANSWER: Input, Output, InputOutput
 
There are three types of parameters that you can use in a .NET Framework and those are Input, Output, InputOutput .
Parameters are like variables that you can use to pass and return values between your application and a database. The types of parameters are defined by SqlDbTypeenumeration. It contains a list of the types available in SQL Server. These parameter values are pass to SQL statements and stored procedures. SQL Server uses the @ symbol as a prefix to denote parameters.
Parameters are Input parameters by default. You can change its direction by using ParameterDirection property.

Example:
SqlParameterparaObj = new SqlParameter();
paraObj.ParameterName = "@TotalCost";
paraObj.SqlDbType = SqlDbType.Money;

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)