1
0
mirror of https://github.com/romanlryji/EventLogLoader.git synced 2024-11-24 08:32:52 +02:00

Не заполнялся код метаданного при чтении из SQLite ЖР.

This commit is contained in:
Alex Bochkov 2015-11-23 22:43:33 -08:00
parent b21cd623bf
commit e87ec15002
2 changed files with 16 additions and 2 deletions

View File

@ -76,7 +76,7 @@
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
@ -93,6 +93,7 @@
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.94.1\lib\net20\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Deployment" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>

View File

@ -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