Пример #1
0
        public DataTable ObtenerCiudad()
        {
            DataTable dtbTmp = new DataTable();

            ServicioProperTime.ServicioProperTimeClient objServicioProperTime;
            objServicioProperTime = new ServicioProperTime.ServicioProperTimeClient();
            try
            {
                objServicioProperTime.Open();
                dtbTmp = objServicioProperTime.RetornarCiudad().Tables[0];

                dtbTmp.PrimaryKey = new DataColumn[] { dtbTmp.Columns[Constantes.ColumnaCiudadesCodigo] };
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (objServicioProperTime != null && objServicioProperTime.State == System.ServiceModel.CommunicationState.Opened)
                {
                    objServicioProperTime.Close();
                }
            }
            return(dtbTmp);
        }