public DataSet SelectTipoOrientacion(ENTTipoOrientacion ENTTipoOrientacion, string ConnectionString) { DataSet ResultData = new DataSet(); SqlConnection Connection = new SqlConnection(ConnectionString); SqlCommand Command; SqlParameter Parameter; SqlDataAdapter DataAdapter; try { Command = new SqlCommand("sptblTipoOrientacion_Sel", Connection); Command.CommandType = CommandType.StoredProcedure; Parameter = new SqlParameter("TipoOrientacionId", SqlDbType.Int); Parameter.Value = ENTTipoOrientacion.TipoOrientacionId; Command.Parameters.Add(Parameter); Parameter = new SqlParameter("Nombre", SqlDbType.VarChar); Parameter.Value = ENTTipoOrientacion.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 BPTipoOrientacion() { _ErrorId = 0; _ErrorDescription = ""; _ENTTipoOrientacion = new ENTTipoOrientacion(); }