public DataSet SelectCanalizacion(ENTCanalizacion ENTCanalizacion, string ConnectionString) { DataSet ResultData = new DataSet(); SqlConnection Connection = new SqlConnection(ConnectionString); SqlCommand Command; SqlParameter Parameter; SqlDataAdapter DataAdapter; try { Command = new SqlCommand("sptblCanalizacion_Sel", Connection); Command.CommandType = CommandType.StoredProcedure; Parameter = new SqlParameter("CanalizacionId", SqlDbType.Int); Parameter.Value = ENTCanalizacion.CanalizacionId; Command.Parameters.Add(Parameter); Parameter = new SqlParameter("Nombre", SqlDbType.VarChar); Parameter.Value = ENTCanalizacion.Nombre; Command.Parameters.Add(Parameter); DataAdapter = new SqlDataAdapter(Command); Connection.Open(); DataAdapter.Fill(ResultData); Connection.Close(); return ResultData; } catch (SqlException Exception) { _ErrorId = Exception.Number; _ErrorDescription = Exception.Message; if (Connection.State == ConnectionState.Open) Connection.Close(); return ResultData; } }
public BPCanalizacion() { _ErrorId = 0; _ErrorDescription = ""; _ENTCanalizacion = new ENTCanalizacion(); }