Corrected Tadatype, Errorhandling of System.Data.SqlTypes.SqlNullValueException

This commit is contained in:
frauseo 2020-05-26 19:58:51 +02:00
parent d73dc261e7
commit ba5aef38d0
2 changed files with 4 additions and 4 deletions

View File

@ -14,11 +14,11 @@ namespace LoggingClient.Model
public string pod { get; set; } public string pod { get; set; }
public string location { get; set; } public string location { get; set; }
public string hostname { get; set; } public string hostname { get; set; }
public string severity { get; set; } public int severity { get; set; }
public DateTime timestamp { get; set; } public DateTime timestamp { get; set; }
public string message { get; set; } public string message { get; set; }
public LogModel(int id, string pod, string location, string hostname, string severity, DateTime timestamp, string message) public LogModel(int id, string pod, string location, string hostname, int severity, DateTime timestamp, string message)
{ {
this.id = id; this.id = id;
this.pod = pod; this.pod = pod;

View File

@ -150,7 +150,7 @@ namespace LoggingClient.ViewModel
reader.GetString("pod"), reader.GetString("pod"),
reader.GetString("location"), reader.GetString("location"),
reader.GetString("hostname"), reader.GetString("hostname"),
reader.GetString("severity"), reader.GetInt32("severity"),
reader.GetDateTime("timestamp"), reader.GetDateTime("timestamp"),
reader.GetString("message") reader.GetString("message")
)); ));
@ -160,7 +160,7 @@ namespace LoggingClient.ViewModel
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show("Error occurred: " + ex.Message); //MessageBox.Show("Error occurred: " + ex.Message);
} }
} }