using (var conn = new SqlConnection(connectionString))
using (var command = new SqlCommand("ProcedureName", conn) {
CommandType = CommandType.StoredProcedure }) {
conn.Open();
command.ExecuteNonQuery();
}
More Related Contents:
- Procedure or function xxxxx has too many arguments specified [duplicate]
- An unhandled exception of type ‘System.InvalidOperationException’ occurred in System.Data.dll?
- How to pass an array into a SQL Server stored procedure
- How to pass table value parameters to stored procedure from .net code
- What are the pros and cons to keeping SQL in Stored Procs versus Code [closed]
- Call a stored procedure with parameter in c#
- Calling stored procedure with return value
- Using stored procedure output parameters in C#
- Getting data from stored procedure with Entity Framework
- Passing List to SQL Stored Procedure
- Using DateTime in a SqlParameter for Stored Procedure, format error
- How to pass XML from C# to a stored procedure in SQL Server 2008?
- What is passing parameters to SQL and why do I need it?
- Add WHERE clauses to SQL dynamically / programmatically
- How to pass a null variable to a SQL Stored Procedure from C#.net code
- 'Must declare the scalar variable "@thisuser".' [closed]
- ExecuteReader requires an open and available Connection. The connection’s current state is Connecting
- What represents a double in sql server?
- How to catch SQLServer timeout exceptions
- Is there any way to embed power bi reports and dashboards in vb.net or C# desktop application with sql server 2008 database?
- How can I retrieve a list of parameters from a stored procedure in SQL Server
- DateTime’s representation in milliseconds?
- What’s the best way to test SQL Server connection programmatically?
- Asking for legitimate example of calling stored procedure C#: MYSQL
- Entity Framework 6 transaction rollback
- Using SqlDataAdapter to insert a row
- “The operation is not valid for the state of the transaction” error and transaction scope
- Bulk Insert Sql Server millions of record
- Loading PictureBox Image From Database
- EF Core takes a lot of time, sometimes, to perform SELECT query