public int ExecuteNonQuery(string storedProcedureName, Dictionary<string, object> parameters) { DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient"); DbCommand command = database.GetStoredProcCommand(storedProcedureName); foreach (KeyValuePair<string, object> parameter in parameters) { database.AddInParameter(command, parameter.Key, parameter.Value); } return database.ExecuteNonQuery(command); }
public object ExecuteScalar(string storedProcedureName, Dictionary <string, object> parameters) { DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient"); DbCommand command = database.GetStoredProcCommand(storedProcedureName); foreach (KeyValuePair <string, object> parameter in parameters) { database.AddInParameter(command, parameter.Key, parameter.Value); } return(database.ExecuteScalar(command)); }
public DataTable LoadTable(string storedProcedureName, Dictionary <string, object> parameters) { DataTable dtTable = new DataTable(); DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient"); DbCommand command = database.GetStoredProcCommand(storedProcedureName); foreach (KeyValuePair <string, object> parameter in parameters) { database.AddInParameter(command, parameter.Key, parameter.Value); } dtTable.Load(database.ExecuteReader(command)); return(dtTable); }
public DataTable LoadTable(string storedProcedureName, Dictionary<string, object> parameters) { DataTable dtTable = new DataTable(); DBProvider database = new DBProvider(rutaContratos, "System.Data.SqlClient"); DbCommand command = database.GetStoredProcCommand(storedProcedureName); foreach (KeyValuePair<string, object> parameter in parameters) { database.AddInParameter(command, parameter.Key, parameter.Value); } dtTable.Load(database.ExecuteReader(command)); return dtTable; }