executenonquery

Why the "Non" in "ExecuteNonQuery"?

I know this is not a hell of an useful question but I can't help being bugged by it. So, Why said method (in *Command classes) is called ExecuteNonQuery instead of ExecuteQuery? Aren't those SQL statements we throw at DBs, queries? ...

my output parameters are always null when i use BeginExecuteNonQuery

I have a stored procedure that returns a varchar(160) as an output parameter of a stored procedure. Everything works fine when i use ExecuteNonQuery, i always get back the expected value. However, once i switch to use BeginExecuteNonQuery, i get a null value for the output. I am using connString + "Asynchronous Processing=true;" in bo...

Jet Database (ms access) ExecuteNonQuery - Can I make it faster?

Hi all, I have this generic routine that I wrote that takes a list of sql strings and executes them against the database. Is there any way I can make this work faster? Typically it'll see maybe 200 inserts or deletes or updates at a time. Sometimes there is a mixture of updates, inserts and deletes. Would it be a good idea to separate th...

error on ExecuteNoQuery()

hey, i'am trying to update a row in a table using : command.ExecuteNoQuery() it's not giving me an error but it's not updating the row This is my code : Dim req As String = "Update Table Set Id= 5" Dim cmd As New OleDb.OleDbCommand(req, connect()) cmd.ExecuteNonQuery() disconnect() thanks ...

ADO.NET and ExecuteNonQuery: how to use DDL

I execute SQL scripts to change the database schema. It looks something like this: using (var command = connection.CreateCommand()) { command.CommandText = script; command.ExecuteNonQuery(); } Additionally, the commands are executed within a transaction. The scrip looks like this: Alter Table [TableName] ADD [NewColumn] bigi...

Problem with cmd.ExecuteNonQuery()

Hi All, I am inserting values in to Database from a Webform using ADO.NET, C#. DB I am using is Oracle Database. Values are not being inserted and the program gets struck at the cmd.ExecuteNonquery() Here is my Code below, Please let me know If I am doing any mistake.. I am using some Static Methods will that be any problem ?.. publ...

command.executeNonQuery does not run storedproc

I am using System.data.Oracleclinet.OracleCommand.ExecuteNonQuery() to run my stored procedure. I observer the following strange thing. When execution runs throught COmmand.executeNonQuery it is giving 1 as the return value 1. But the stored procedure is not run and the output variable shows empty value({}). But if I run the same(comm...

Correct this SQL Query: error "Microsoft Jet database engine cannot find the input table or query 'IF' "

Hi every one, i should say hi experts :D . Help me with this pretty code :) The database: "ID (Primary key)" | "Title" 0 | "title1" 1 | "title2" 2 | "title3" 3 | "title4" Sub AddRecord(ByVal Table As String, ByVal Columns As String, ByVal Record() As String) D...

SqlException.Message duplicated when calling sqlserver stored proc

I have a stored procedure that gives a friendly enough error that I want to show to the users but when I call it from .net it comes out twice. When I call the proc from sql server management studio it only comes out once. Here is a cutdown version of the stored proc: ALTER PROC [Production].[spDoSomething] ( @PassedID int) ...

How to pass variable into SqlCommand statement and insert into database table

Hello, I'm writing a small program in C# that uses SQL to store values into a database at runtime based on input by the user. The only problem is I can't figure out the correct Sql syntax to pass variables into my database. private void button1_Click(object sender, EventArgs e) { int num = 2; using (SqlCeConnection...