Skip to main content
  • Función javascript que genera la tabla en la pagina html:

Función javascript que genera la tabla en la pagina html:

function getData() {
        var $tbl = $('#tableEvents');
        $.ajax({
            url: '../home/Get',
            type: 'GET',
            datatype: 'json',
            success: function (data) {
                debugger;
                alert(data);
                if (data.length >> 0) {
                    var newdata = data;
                    $tbl.empty();
                    $tbl.append(' @Html<tr class="columns"><th>@Html.DisplayNameFor(model =>=> model.NameEvent)@Html</th><th>@Html.DisplayNameFor(model =>=> model.Protocol)@Html</th><th>@Html.DisplayNameFor(model =>=> model.IP)@Html</th><th>@Html.DisplayNameFor(model =>=> model.Port)@Html</th><th>@Html.DisplayNameFor(model =>=> model.AccountID)@Html</th><th>@Html.DisplayNameFor(model =>=> model.SessionID)@Html</th><th>@Html.DisplayNameFor(model =>=> model.DateEvent)@Html</th><th>@Html.DisplayNameFor(model =>=> model.SecurityImpact)@Html</th><th>@Html.DisplayNameFor(model =>=> model.Resolved)'</th></tr>');
                    var rows = [];
                    for (var i = 0; i < newdata.length; i++) {
                    rows.push(' <tr class="rowEvent"><td>' + newdata[i].NameEvent +
                            '''</td><td>' + newdata[i].Protocol +
                            '''</td><td>' + newdata[i].IP +
                            '''</td><td>' + newdata[i].Port +
                            '''</td><td>' + newdata[i].AccountID +
                            '''</td><td>' + newdata[i].SessionID +
                            '''</td><td>' + newdata[i].DateEvent +
                            '''</td><td>' + newdata[i].SecurityImpact +
                        '</td><td><input type="checkbox" id="' + 'newdata[i].Id ');
+ '" value="' + newdata[i].Resolved + '"/></td><td><a class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-info-sign"></span></a></td></tr > ');
         }
       }
                $tbl.append(rows.join(''));
                }
            }
        }); 
 }
  • HomeController:

HomeController:


 SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

        [Route("Home"Home/Get"Get")]
        public IEnumerableIEnumerable<SECURITYEVENTS> Get()
        {
            var events = objRepo.GetData();
            return events;
        }
  
  • Repositorio: public class SECURITYEVENTSRepository { public IEnumerable GetData() {

              using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
              {
                  connection.Open();
                  using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                  {
                      // Make sure the command object does not already have
                      // a notification object associated with it.
                      command.Notification = null;
    
                      SqlDependency dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
    
                      var events = new List<SECURITYEVENTS>();
    
                      using (var reader = command.ExecuteReader())
                          events = reader.Cast<IDataRecord>()
                              .Select(x => new SECURITYEVENTS()
                              {
                                  Id = (int)x["Id"],
                                  NameEvent = (string)x["NameEvent"],
                                  Protocol = (string)x["Protocol"],
                                  IP = (string)x["IP"],
                                  Port = (int)x["Port"],
                                  AccountID = (string)x["AccountID"],
                                  SessionID = (string)x["SessionID"],
                                  DateEvent = (string)x["DateEvent"],
                                  SecurityImpact = (string)x["SecurityImpact"],
                                  Resolved = (string)x["Resolved"],
                              }).ToList();
                  return events;
                  }
              }
          }
          private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
          {
              EventsHub.Show();
          }
    
      }
    
  • Modelo:

Repositorio:

public class SECURITYEVENTSRepository
{
        public partialIEnumerable<SECURITYEVENTS> classGetData()
 SECURITYEVENTS       {

            using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
            {
        public int Id      connection.Open();
                using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                { 
 get; set; }                 // Make sure the command object does not already have
        public string NameEvent          // a notification object associated with it.
                    command.Notification = null;

                    SqlDependency dependency = new SqlDependency(command);
                    dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);

                    if (connection.State == ConnectionState.Closed)
                        connection.Open();

                    var events = new List<SECURITYEVENTS>();

                    using (var reader = command.ExecuteReader())
                        events = reader.Cast<IDataRecord>()
                            .Select(x => new SECURITYEVENTS()
                            { 
 get; set; }                             Id = (int)x["Id"],
        public                        NameEvent = (string)x["NameEvent"],
                                Protocol {= get;(string)x["Protocol"],
 set; }                              IP = (string)x["IP"],
        public                        Port = (int)x["Port"],
                                AccountID = (string)x["AccountID"],
 IP { get; set;                            SessionID = (string)x["SessionID"],
                                DateEvent = (string)x["DateEvent"],
                                SecurityImpact = (string)x["SecurityImpact"],
                                Resolved = (string)x["Resolved"],
                            }).ToList();
                return events;
                }
        public Nullable Port  }
        }
        private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
        { 
 get; set;          EventsHub.Show();
        }
    }

Modelo:

public partial class SECURITYEVENTS
{
    public stringint AccountIDId { get; set; }
    public string NameEvent { get; set; }
    public string SessionIDProtocol { get; set; }
    public string IP { get; set; }
    public stringNullable<int> DateEventPort { get; set; }
    public string AccountID { get; set; }
    public string SecurityImpactSessionID { get; set; }
    public string DateEvent { get; set; }
    public string ResolvedSecurityImpact { get; set; }
    public string Resolved { get; set; }
 }
  • Función javascript que genera la tabla en la pagina html:
function getData() {
        var $tbl = $('#tableEvents');
        $.ajax({
            url: '../home/Get',
            type: 'GET',
            datatype: 'json',
            success: function (data) {
                debugger;
                alert(data);
                if (data.length > 0) {
                    var newdata = data;
                    $tbl.empty();
                    $tbl.append(' @Html.DisplayNameFor(model => model.NameEvent)@Html.DisplayNameFor(model => model.Protocol)@Html.DisplayNameFor(model => model.IP)@Html.DisplayNameFor(model => model.Port)@Html.DisplayNameFor(model => model.AccountID)@Html.DisplayNameFor(model => model.SessionID)@Html.DisplayNameFor(model => model.DateEvent)@Html.DisplayNameFor(model => model.SecurityImpact)@Html.DisplayNameFor(model => model.Resolved)');
                    var rows = [];
                    for (var i = 0; i ' + newdata[i].NameEvent +
                            '' + newdata[i].Protocol +
                            '' + newdata[i].IP +
                            '' + newdata[i].Port +
                            '' + newdata[i].AccountID +
                            '' + newdata[i].SessionID +
                            '' + newdata[i].DateEvent +
                            '' + newdata[i].SecurityImpact +
                            ' ');
                    }
                    $tbl.append(rows.join(''));
                }
            }
        }); 
 
  • HomeController:

 SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

        [Route("Home/Get")]
        public IEnumerable Get()
        {
            var events = objRepo.GetData();
            return events;
        }
 
  • Repositorio: public class SECURITYEVENTSRepository { public IEnumerable GetData() {

              using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
              {
                  connection.Open();
                  using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                  {
                      // Make sure the command object does not already have
                      // a notification object associated with it.
                      command.Notification = null;
    
                      SqlDependency dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
    
                      var events = new List<SECURITYEVENTS>();
    
                      using (var reader = command.ExecuteReader())
                          events = reader.Cast<IDataRecord>()
                              .Select(x => new SECURITYEVENTS()
                              {
                                  Id = (int)x["Id"],
                                  NameEvent = (string)x["NameEvent"],
                                  Protocol = (string)x["Protocol"],
                                  IP = (string)x["IP"],
                                  Port = (int)x["Port"],
                                  AccountID = (string)x["AccountID"],
                                  SessionID = (string)x["SessionID"],
                                  DateEvent = (string)x["DateEvent"],
                                  SecurityImpact = (string)x["SecurityImpact"],
                                  Resolved = (string)x["Resolved"],
                              }).ToList();
                  return events;
                  }
              }
          }
          private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
          {
              EventsHub.Show();
          }
    
      }
    
  • Modelo:


    public partial class SECURITYEVENTS
    {
        public int Id { get; set; }
        public string NameEvent { get; set; }
        public string Protocol { get; set; }
        public string IP { get; set; }
        public Nullable Port { get; set; }
        public string AccountID { get; set; }
        public string SessionID { get; set; }
        public string DateEvent { get; set; }
        public string SecurityImpact { get; set; }
        public string Resolved { get; set; }
    }
 

Función javascript que genera la tabla en la pagina html:

function getData() {
    var $tbl = $('#tableEvents');
    $.ajax({
        url: '../home/Get',
        type: 'GET',
        datatype: 'json',
        success: function (data) {
            debugger;
            alert(data);
            if (data.length > 0) {
                var newdata = data;
                $tbl.empty();
                $tbl.append(' <tr class="columns"><th>@Html.DisplayNameFor(model => model.NameEvent)</th><th>@Html.DisplayNameFor(model => model.Protocol)</th><th>@Html.DisplayNameFor(model => model.IP)</th><th>@Html.DisplayNameFor(model => model.Port)</th><th>@Html.DisplayNameFor(model => model.AccountID)</th><th>@Html.DisplayNameFor(model => model.SessionID)</th><th>@Html.DisplayNameFor(model => model.DateEvent)</th><th>@Html.DisplayNameFor(model => model.SecurityImpact)</th><th>@Html.DisplayNameFor(model => model.Resolved)</th></tr>');
                var rows = [];
                for (var i = 0; i < newdata.length; i++) {
                    rows.push(' <tr class="rowEvent"><td>' + newdata[i].NameEvent +
                        '</td><td>' + newdata[i].Protocol +
                        '</td><td>' + newdata[i].IP +
                        '</td><td>' + newdata[i].Port +
                        '</td><td>' + newdata[i].AccountID +
                        '</td><td>' + newdata[i].SessionID +
                        '</td><td>' + newdata[i].DateEvent +
                        '</td><td>' + newdata[i].SecurityImpact +
                        '</td><td><input type="checkbox" id="' + newdata[i].Id + '" value="' + newdata[i].Resolved + '"/></td><td><a class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-info-sign"></span></a></td></tr > ');
                }
                $tbl.append(rows.join(''));
            }
        }
    }); 
}

HomeController:

SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

[Route("Home/Get")]
public IEnumerable<SECURITYEVENTS> Get()
{
    var events = objRepo.GetData();
    return events;
}
 

Repositorio:

public class SECURITYEVENTSRepository
{
        public IEnumerable<SECURITYEVENTS> GetData()
        {

            using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                { 
                    // Make sure the command object does not already have
                    // a notification object associated with it.
                    command.Notification = null;

                    SqlDependency dependency = new SqlDependency(command);
                    dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);

                    if (connection.State == ConnectionState.Closed)
                        connection.Open();

                    var events = new List<SECURITYEVENTS>();

                    using (var reader = command.ExecuteReader())
                        events = reader.Cast<IDataRecord>()
                            .Select(x => new SECURITYEVENTS()
                            { 
                                Id = (int)x["Id"],
                                NameEvent = (string)x["NameEvent"],
                                Protocol = (string)x["Protocol"],
                                IP = (string)x["IP"],
                                Port = (int)x["Port"],
                                AccountID = (string)x["AccountID"],
                                SessionID = (string)x["SessionID"],
                                DateEvent = (string)x["DateEvent"],
                                SecurityImpact = (string)x["SecurityImpact"],
                                Resolved = (string)x["Resolved"],
                            }).ToList();
                return events;
                }
            }
        }
        private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
        { 
            EventsHub.Show();
        }
    }

Modelo:

public partial class SECURITYEVENTS
{
    public int Id { get; set; }
    public string NameEvent { get; set; }
    public string Protocol { get; set; }
    public string IP { get; set; }
    public Nullable<int> Port { get; set; }
    public string AccountID { get; set; }
    public string SessionID { get; set; }
    public string DateEvent { get; set; }
    public string SecurityImpact { get; set; }
    public string Resolved { get; set; }
}
se añadieron 18 caracteres en el cuerpo
Origen Enlace
Ace
  • 115
  • 1
  • 1
  • 10
  • HomeController: SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

      [Route("Home/Get")]
      public IEnumerable<SECURITYEVENTS> Get()
      {
          var events = objRepo.GetData();
          return events;
      }
    
    HomeController:

SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

        [Route("Home/Get")]
        public IEnumerable Get()
        {
            var events = objRepo.GetData();
            return events;
        }
  • Repositorio: public class SECURITYEVENTSRepository { public IEnumerable GetData() {

              using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
              {
                  connection.Open();
                  using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                  {
                      // Make sure the command object does not already have
                      // a notification object associated with it.
                      command.Notification = null;
    
                      SqlDependency dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
    
                      var events = new List<SECURITYEVENTS>();
    
                      using (var reader = command.ExecuteReader())
                          events = reader.Cast<IDataRecord>()
                              .Select(x => new SECURITYEVENTS()
                              {
                                  Id = (int)x["Id"],
                                  NameEvent = (string)x["NameEvent"],
                                  Protocol = (string)x["Protocol"],
                                  IP = (string)x["IP"],
                                  Port = (int)x["Port"],
                                  AccountID = (string)x["AccountID"],
                                  SessionID = (string)x["SessionID"],
                                  DateEvent = (string)x["DateEvent"],
                                  SecurityImpact = (string)x["SecurityImpact"],
                                  Resolved = (string)x["Resolved"],
                              }).ToList();
                  return events;
                  }
              }
          }
          private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
          {
              EventsHub.Show();
          }
    
      }
    
  • Modelo:

  • HomeController: SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

      [Route("Home/Get")]
      public IEnumerable<SECURITYEVENTS> Get()
      {
          var events = objRepo.GetData();
          return events;
      }
    
  • Repositorio: public class SECURITYEVENTSRepository { public IEnumerable GetData() {

              using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
              {
                  connection.Open();
                  using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                  {
                      // Make sure the command object does not already have
                      // a notification object associated with it.
                      command.Notification = null;
    
                      SqlDependency dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
    
                      var events = new List<SECURITYEVENTS>();
    
                      using (var reader = command.ExecuteReader())
                          events = reader.Cast<IDataRecord>()
                              .Select(x => new SECURITYEVENTS()
                              {
                                  Id = (int)x["Id"],
                                  NameEvent = (string)x["NameEvent"],
                                  Protocol = (string)x["Protocol"],
                                  IP = (string)x["IP"],
                                  Port = (int)x["Port"],
                                  AccountID = (string)x["AccountID"],
                                  SessionID = (string)x["SessionID"],
                                  DateEvent = (string)x["DateEvent"],
                                  SecurityImpact = (string)x["SecurityImpact"],
                                  Resolved = (string)x["Resolved"],
                              }).ToList();
                  return events;
                  }
              }
          }
          private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
          {
              EventsHub.Show();
          }
    
      }
    
  • Modelo:

  • HomeController:

SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

        [Route("Home/Get")]
        public IEnumerable Get()
        {
            var events = objRepo.GetData();
            return events;
        }
  • Repositorio: public class SECURITYEVENTSRepository { public IEnumerable GetData() {

              using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
              {
                  connection.Open();
                  using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                  {
                      // Make sure the command object does not already have
                      // a notification object associated with it.
                      command.Notification = null;
    
                      SqlDependency dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
    
                      var events = new List<SECURITYEVENTS>();
    
                      using (var reader = command.ExecuteReader())
                          events = reader.Cast<IDataRecord>()
                              .Select(x => new SECURITYEVENTS()
                              {
                                  Id = (int)x["Id"],
                                  NameEvent = (string)x["NameEvent"],
                                  Protocol = (string)x["Protocol"],
                                  IP = (string)x["IP"],
                                  Port = (int)x["Port"],
                                  AccountID = (string)x["AccountID"],
                                  SessionID = (string)x["SessionID"],
                                  DateEvent = (string)x["DateEvent"],
                                  SecurityImpact = (string)x["SecurityImpact"],
                                  Resolved = (string)x["Resolved"],
                              }).ToList();
                  return events;
                  }
              }
          }
          private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
          {
              EventsHub.Show();
          }
    
      }
    
  • Modelo:

Origen Enlace
Ace
  • 115
  • 1
  • 1
  • 10

Problema al recibir respuesta petición get ajax

Buenas tardes, estoy desarrollando una aplicación web basada en MVC que muestra los datos de una tabla sql server y los va actualizando. Recibo bien los datos de sql server mediente el método "GetData()" que retorna una lista con ellos. El problema es que al hacer la petición get al controlador que invoca esta función para retornarlos en la vista, estos datos aparecen como "undefined". He mirado la variable "data" que correspondería con la respuesta de la petición y esta en lugar de contener los datos contiene el tipo de dato que debería de contener, es decir "System.Collections.Generic.List'1".

  • Función javascript que genera la tabla en la pagina html:
function getData() {
        var $tbl = $('#tableEvents');
        $.ajax({
            url: '../home/Get',
            type: 'GET',
            datatype: 'json',
            success: function (data) {
                debugger;
                alert(data);
                if (data.length > 0) {
                    var newdata = data;
                    $tbl.empty();
                    $tbl.append(' @Html.DisplayNameFor(model => model.NameEvent)@Html.DisplayNameFor(model => model.Protocol)@Html.DisplayNameFor(model => model.IP)@Html.DisplayNameFor(model => model.Port)@Html.DisplayNameFor(model => model.AccountID)@Html.DisplayNameFor(model => model.SessionID)@Html.DisplayNameFor(model => model.DateEvent)@Html.DisplayNameFor(model => model.SecurityImpact)@Html.DisplayNameFor(model => model.Resolved)');
                    var rows = [];
                    for (var i = 0; i ' + newdata[i].NameEvent +
                            '' + newdata[i].Protocol +
                            '' + newdata[i].IP +
                            '' + newdata[i].Port +
                            '' + newdata[i].AccountID +
                            '' + newdata[i].SessionID +
                            '' + newdata[i].DateEvent +
                            '' + newdata[i].SecurityImpact +
                            ' ');
                    }
                    $tbl.append(rows.join(''));
                }
            }
        }); 
  • HomeController: SECURITYEVENTSRepository objRepo = new SECURITYEVENTSRepository();

      [Route("Home/Get")]
      public IEnumerable<SECURITYEVENTS> Get()
      {
          var events = objRepo.GetData();
          return events;
      }
    
  • Repositorio: public class SECURITYEVENTSRepository { public IEnumerable GetData() {

              using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
              {
                  connection.Open();
                  using (SqlCommand command = new SqlCommand(@"SELECT  [Id],[NameEvent],[Protocol],[IP],[Port],[AccountID],[SessionID],[DateEvent],[SecurityImpact],[Resolved] FROM [events].[dbo].[SECURITYEVENTS]", connection))
                  {
                      // Make sure the command object does not already have
                      // a notification object associated with it.
                      command.Notification = null;
    
                      SqlDependency dependency = new SqlDependency(command);
                      dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    
                      if (connection.State == ConnectionState.Closed)
                          connection.Open();
    
                      var events = new List<SECURITYEVENTS>();
    
                      using (var reader = command.ExecuteReader())
                          events = reader.Cast<IDataRecord>()
                              .Select(x => new SECURITYEVENTS()
                              {
                                  Id = (int)x["Id"],
                                  NameEvent = (string)x["NameEvent"],
                                  Protocol = (string)x["Protocol"],
                                  IP = (string)x["IP"],
                                  Port = (int)x["Port"],
                                  AccountID = (string)x["AccountID"],
                                  SessionID = (string)x["SessionID"],
                                  DateEvent = (string)x["DateEvent"],
                                  SecurityImpact = (string)x["SecurityImpact"],
                                  Resolved = (string)x["Resolved"],
                              }).ToList();
                  return events;
                  }
              }
          }
          private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
          {
              EventsHub.Show();
          }
    
      }
    
  • Modelo:


    public partial class SECURITYEVENTS
    {
        public int Id { get; set; }
        public string NameEvent { get; set; }
        public string Protocol { get; set; }
        public string IP { get; set; }
        public Nullable Port { get; set; }
        public string AccountID { get; set; }
        public string SessionID { get; set; }
        public string DateEvent { get; set; }
        public string SecurityImpact { get; set; }
        public string Resolved { get; set; }
    }

Agradezco vuestra ayuda, Un saludo.