Top "Executescalar" questions

- Executes a query, and returns the first column of the first row in the query-result set.

Cannot implicitly convert type 'int?' to 'int'.

I'm getting the error "Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a …

c# executescalar
ExecuteScalar vs ExecuteNonQuery when returning an identity value

Trying to figure out if it's best to use ExecuteScalar or ExecuteNonQuery if I want to return the identity column …

c# sql-server executenonquery executescalar
Int32.TryParse() or (int?)command.ExecuteScalar()

I have a SQL query which returns only one field - an ID of type INT. And I have to …

c# .net ado.net tryparse executescalar
ExecuteScalar returns null or DBNull (development or production server)

I'm trying to add a column to an existing DataRow in C#. Afterwards the column will be filled with a …

c# dbnull asp.net-development-serv executescalar
Display SQL query result in a label in asp.net

I'm trying to display the SQL query result in a label but it's not showing. This is my code: string …

c# asp.net sql executescalar
casting ExecuteScalar() result c#

why would this work int collectionCharge = (int)cmdCheck.ExecuteScalar(); but this produces an exception double collectionCharge = (double)cmdCheck.ExecuteScalar(); System.…

c# asp.net casting executescalar
What is a "Scalar" Query?

I am using LLBLGEN where there is a method to execute a query as a scalar query. Googling gives me …

sql database executescalar llblgen
How to create array DbParameter[]

The manual says that the ExecuteScalar method should be used like: public T ExecuteScalar<T>( string commandText, CommandType …

c# sql executescalar
C# cmd.ExecuteScalar(): "Cannot continue the execution because the session is in the kill state."

Getting a weird exception from ExecuteScalar() that I cannot find any help for on the web: Cannot continue the execution …

c# sql sql-server executescalar
SqlCommand.ExecuteReader and getting past the first row

I'm fairly new to ASP.NET and as a self-chosen assignment I am to create a simple blog. It's very …

c# asp.net sql sqlcommand executescalar