ExecuteNonQuery() public static method

Execute a SqlCommand (that returns no resultset and takes no parameters) against the provided SqlConnection.
e.g.: int result = ExecuteNonQuery(conn, CommandType.StoredProcedure, "PublishOrders");
public static ExecuteNonQuery ( SqlConnection connection, CommandType commandType, string commandText ) : int
connection System.Data.SqlClient.SqlConnection A valid SqlConnection
commandType CommandType The CommandType (stored procedure, text, etc.)
commandText string The stored procedure name or T-SQL command
return int
Beispiel #1
0
 public void DeleteUser(int id)
 {
     SqlHelper.ExecuteNonQuery(cs, "DeleteUser", id);
 }
Beispiel #2
0
 public void UpdateUser(int userId, string name, string lastname, string phone, string password, string city, string role, string email)
 {
     SqlHelper.ExecuteNonQuery(cs, "UpdateUser", userId, name, lastname, phone, password, city, role, email);
 }
Beispiel #3
0
 public void AddUser(string name, string lastname, string phone, string password, string city, string role, string email)
 {
     SqlHelper.ExecuteNonQuery(cs, "AddUser", name, lastname, phone, password, city, role, email);
 }