Top "Executenonquery" questions

executes an SQL statement against the Connection object of a .NET Framework data provider, and returns the number of rows affected.

Inserting values into a SQL Server database using ado.net via C#

I have created a simple program to insert values into the table [regist], but I keep getting the error Incorrect …

c# sql sql-server ado.net executenonquery
Get affected rows on ExecuteNonQuery

I am currently working on a C# project and I am running an insert query which also does a select …

c# mysql .net sql executenonquery
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
c#: ExecuteNonQuery() returns -1

Ive used this method before to return the amount of rows changed. I am it to run an insert method, …

c# executenonquery
VB.NET SQL Server Insert - ExecuteNonQuery: Connection property has not been initialized

In the form load event, I connect to the SQL Server database: Private Sub AddBook_Load(ByVal sender As System.…

sql vb.net executenonquery
How to pass variable into SqlCommand statement and insert into database table

I'm writing a small program in C# that uses SQL to store values into a database at runtime based on …

c# sql sqlcommand executenonquery
ExecuteNonQuery() for Insert

Can you please tell me what's wrong with this code? Do I need to use DataAdapter to insert into a …

vb.net visual-studio sql-server-2008 insert executenonquery
ExecuteNonQuery() returns -1 always

I am using a stored procedure to insert some value in table. CREATE PROCEDURE [dbo].[Sp_InsertValue] @Val1 as nvarchar(50) @…

c# asp.net executenonquery
C# ExecuteNonQuery "Connection must be valid and open."

I'm trying to add values into database, but every time I try to add some thing i get an error …

c# database executenonquery
.ExecuteNonQuery() sql asp.net error

This is my first time working with sql and asp.net. I am working on a few examples to ensure …

asp.net sql visual-studio-2012 executenonquery