From e87ec150028ce8f114a514a2d2d000bd7b7fc4a2 Mon Sep 17 00:00:00 2001 From: Alex Bochkov Date: Mon, 23 Nov 2015 22:43:33 -0800 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=20=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D1=8F=D0=BB=D1=81=D1=8F=20=D0=BA=D0=BE=D0=B4=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=B0=D0=B4=D0=B0=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=B8=D0=B7=20SQLite=20=D0=96=D0=A0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EventLogLoader/EventLogLoaderDebug.vbproj | 3 ++- EventLogLoaderService/Service1.vb | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/EventLogLoader/EventLogLoaderDebug.vbproj b/EventLogLoader/EventLogLoaderDebug.vbproj index 78efe0d..8129712 100644 --- a/EventLogLoader/EventLogLoaderDebug.vbproj +++ b/EventLogLoader/EventLogLoaderDebug.vbproj @@ -76,7 +76,7 @@ true - true + false @@ -93,6 +93,7 @@ ..\packages\System.Data.SQLite.Linq.1.0.94.1\lib\net20\System.Data.SQLite.Linq.dll + diff --git a/EventLogLoaderService/Service1.vb b/EventLogLoaderService/Service1.vb index 99dc9a4..02ca5d5 100644 --- a/EventLogLoaderService/Service1.vb +++ b/EventLogLoaderService/Service1.vb @@ -685,7 +685,12 @@ Public Class EventLogLoaderService command.Parameters.Add(New SqlParameter("@v9", SqlDbType.Char)).Value = Ev.EventType command.Parameters.Add(New SqlParameter("@v10", SqlDbType.VarChar)).Value = Ev.Comment command.Parameters.Add(New SqlParameter("@v11", SqlDbType.Int)).Value = Ev.MetadataID + + If Ev.DataStructure.Length > 100 Then + Ev.DataStructure = Ev.DataStructure.Substring(0, 99) + End If command.Parameters.Add(New SqlParameter("@v12", SqlDbType.Char)).Value = Ev.DataStructure + command.Parameters.Add(New SqlParameter("@v13", SqlDbType.VarChar)).Value = Ev.DataString command.Parameters.Add(New SqlParameter("@v14", SqlDbType.Int)).Value = Ev.ServerID command.Parameters.Add(New SqlParameter("@v15", SqlDbType.Int)).Value = Ev.MainPortID @@ -1226,7 +1231,15 @@ Public Class EventLogLoaderService OneEvent.EventID = rs("eventCode") OneEvent.Comment = rs("comment") 'OneEvent.MetadataID = rs("metadataCodes") - OneEvent.MetadataID = 0 + Dim MDCodes As String = rs("metadataCodes") + If String.IsNullOrEmpty(MDCodes) Then + OneEvent.MetadataID = 0 + ElseIf MDCodes.Contains(",") Then + Dim MDCode As String = MDCodes.Split(New Char() {","c}).GetValue(0) + Integer.TryParse(MDCode, OneEvent.MetadataID) + Else + Integer.TryParse(MDCodes, OneEvent.MetadataID) + End If Dim s = "" If Not String.IsNullOrEmpty(rs("data")) Then