Exemplo n.º 1
0
 internal SqlDataReader ExecuteReader(VivendiSource source, string commandText, params SqlParameter[] parameters) =>
 // return a reader that closes the connection once it's disposed
 BuildCommand(OpenConnection(source), commandText, parameters).ExecuteReader(CommandBehavior.CloseConnection);
Exemplo n.º 2
0
 internal object ExecuteScalar(VivendiSource source, string commandText, params SqlParameter[] parameters)
 {
     // run a simple query
     using var connection = OpenConnection(source);
     return(BuildCommand(connection, commandText, parameters).ExecuteScalar());
 }
Exemplo n.º 3
0
 internal int ExecuteNonQuery(VivendiSource source, string commandText, params SqlParameter[] parameters)
 {
     // run a INSERT, UPDATE or DELETE command and return the affected rows
     using var connection = OpenConnection(source);
     return(BuildCommand(connection, commandText, parameters).ExecuteNonQuery());
 }