47
Reply

Define Execute Scalar?

Mohan Gupta

Mohan Gupta

Jul 03, 2013
8.1k
1

    ExecuteScalar() in SqlCommand Object is used for get a single value from Database after its execution. It executes SQL statements or Stored Procedure and returned a scalar value on first column of first row in the Result Set. If the Result Set contains more than one columns or rows , it takes only the first column of first row, all other values will ignore. If the Result Set is empty it will return a Null reference.It is very useful to use with aggregate functions like Count(*) or Sum() etc. When compare to ExecuteReader() , ExecuteScalar() uses fewer System resources.

    Satish Verma
    September 26, 2013
    2

    It execute Query and return Single value

    sajidlkhan lodi
    February 09, 2015
    1

    Execute scalar is return only one column and one row from database and this is the one of the ADO.Net Command

    Bhabani Prasad
    May 21, 2014
    1

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    Bharathi Raja
    January 20, 2018
    0

    The query which returns single result

    Manoj Kumar
    January 03, 2017
    0

    For fetching a single cell(which rresults from a sql command) value.

    Srikanth Reddy
    November 04, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar is typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might be SELECT @@IDENTITY AS 'Identity'.

    bharat aggarwal
    October 16, 2015
    0

    ExecuteScalar() It is a predefined member method of Command class. Used to execute and return single record at a time from the database. the return of the ExecuteScalar() method is object

    Srinivas Pabballa
    August 28, 2015
    0

    Its always return one value from database after its execution

    Yatendra Sharma
    July 23, 2015
    0

    ExecuteScalar returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

    Sujeet Suman
    July 02, 2015
    0

    returns Single cell as output. Ex: select max sal from empsingle cell. o/p: 34000

    Srikanth Reddy
    June 17, 2015
    0

    It return first column of first row value

    Rahul Prajapat
    May 26, 2015
    0

    it return first element of first column of first row of table as a object.......

    ExecuteScalar is return a single value,the return values type is integer format.when we want table record count only use this executescalar.

    CHANDRAN KANDAN
    March 27, 2015
    0

    It is a command object which is used in DML command and it return single value.

    Munesh Sharma
    April 04, 2014
    0

    It is a method of command object. It will return only one value, i.e [object] type.

    subrat padhy
    November 01, 2013
    0
    Vivek Gupta
    October 12, 2013
    0

    Execute scalar is return only one column and one row from database and this is the one of the ADO.Net Command

    Pramod Lawate
    August 26, 2013
    0

    It is one of the way to execute select command in sqlserver through code behind. It will return first row's first column as a result. Basically use this sqlcommand when we use aggregate function in Sql Query.

    Sandeep Ghosh
    August 15, 2013
    0

    Execute Scalar is using to retrieve a data from database

    Bineesh VP
    August 05, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    It is used to perform the query which returns singal record like Sum(),Max(),Avrg().It return type will be Object so we need to cast them.

    Abhineet Srivastava
    July 18, 2013
    0

    ExecuteScalar is a method of SQLCommand that Executes the query, and returns the first column of the first row of the result set returned by the query. Returns only the first column of the first row. SELECT count(*) FROM table_name;

    Srikaran N Sarma
    July 14, 2013
    0

    Execute Scalar is an ADO.NET object which is used to get single value from Back End using Aggregate Functions

    nethaji naidu
    July 10, 2013
    0

    If we want to fetch only one value from the back end then we can go for Execute Scalar

    Srikanth Reddy
    July 09, 2013
    0

    If we want to fetch only one value from the back end then we can go for Execute Scalar

    Srikanth Reddy
    July 09, 2013
    0

    In Ado.Net Command Execute Scalar always return a Single Object and you have to cast or convert value from this Object you cant directly use it.

    Kunal Vaishya
    July 09, 2013
    0

    It is one of the command object in ADO.NET. It will return only a single value. That is 1st column of the 1st row value. Ex: All Aggregate functions.

    lavanya veerasamy
    July 08, 2013
    0

    Bharat Gunjal
    July 07, 2013
    0

    Execute Scalar will work with Non-Action Queries(select) that contain aggregate functions.

    Dhiraj Sharma
    July 06, 2013
    0