executescalar Questions

10

Solved

I'm getting the error "Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)" on my OrdersPerHour at the return line. I'm not sure why because my C...
Weighting asked 28/5, 2013 at 17:42

5

Solved

why would this work int collectionCharge = (int)cmdCheck.ExecuteScalar(); but this produces an exception double collectionCharge = (double)cmdCheck.ExecuteScalar(); System.InvalidCastExcept...
Walburga asked 15/3, 2013 at 15:4

5

Solved

The manual says that the ExecuteScalar method should be used like: public T ExecuteScalar<T>( string commandText, CommandType commandType, params DbParameter[] parameters ) But how do ...
Betjeman asked 17/8, 2011 at 18:26

0

There's simple .sql file like this:- helloworld.sql DECLARE message varchar2(20):= 'Hello, World!'; BEGIN dbms_output.put_line(message); END; I want to call the file in C# console app, ca...
Naturalist asked 11/3, 2019 at 6:19

3

Solved

I am using LLBLGEN where there is a method to execute a query as a scalar query. Googling gives me a definition for scalar sub-query, are they the same ?
Lakin asked 6/12, 2013 at 13:20

3

Solved

I'm trying to add a column to an existing DataRow in C#. Afterwards the column will be filled with a single value from my database. DataRow dr already exists and column "COLNAME" also exists. comT...
Mindexpanding asked 28/10, 2011 at 9:6

7

Solved

I have a SQL query which returns only one field - an ID of type INT. And I have to use it as integer in C# code. Which way is faster and uses less memory? int id; if(Int32.TryParse(command.Execu...
Megawatt asked 23/7, 2009 at 22:50

2

I'm not sure why this is happening. I've seen the same issue online with little help out there to correct it. When i run my query inside Access i get different values ranging from 0 - 10 but for s...
Kktp asked 24/5, 2013 at 22:33

1

Solved

Trying to figure out if it's best to use ExecuteScalar or ExecuteNonQuery if I want to return the identity column of a newly inserted row. I have read this question and I understand the differences...
Dailey asked 9/1, 2013 at 21:21

4

Solved

I have a code as bellow where I try to insert a data into a table and return the ID (given by auto increment) of the new element. int newEquipmentID = new int(); query = database.ParameterizedQue...
Synthesis asked 18/4, 2012 at 14:3

2

Solved

I have a batch of sql statements such as ... insert into.... ; insert into.... ; delete .........; etc When i try to execute them against oracle it gives me this error (ORA-00911 Invalid Charact...
Romanist asked 26/3, 2009 at 13:42

2

Solved

Can you use int blah = Convert.ToInt32(cmd.ExecuteScalar()); When the sproc's last statement does: RETURN @value I can only get it to work if it does: SELECT @value Also, this gives me a o...
Mattson asked 6/2, 2009 at 15:34
1

© 2022 - 2024 — McMap. All rights reserved.