Google News
logo
ADO.NET - Quiz(MCQ)
What are the three primary kinds of parameters?
A)
int, varchar, nvarchar
B)
Input, Integer, String
C)
Integer, String, DateTime
D)
Input, Output, InputOutput

Correct Answer :   Input, Output, InputOutput


Explanation : 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;

Advertisement