private static SqlDataRecord buildRecord(SqlMetaData[] metadata,EventLogEntry entry)
    {
        SqlDataRecord record     = new SqlDataRecord(metadata);

        record.SetSqlInt32(0, entry.Index);
        record.SetSqlInt64(1, entry.InstanceId);
        record.SetSqlDateTime(2, entry.TimeWritten);
        record.SetSqlString(3, entry.MachineName);
        record.SetSqlString(4, entry.Source);
        record.SetSqlString(5, entry.UserName);
        record.SetSqlString(6, entry.Message);

        return record;
    }
Beispiel #2
0
        private static void SendCommandStatus(SqlPipe pipe, SqlInt32 status, SqlString substatus)
        {
            SqlDataRecord rec = new SqlDataRecord(
                  new SqlMetaData("Status", SqlDbType.Int)
                , new SqlMetaData("SubStatus", SqlDbType.NVarChar, 150)
                );

            SqlContext.Pipe.SendResultsStart(rec);

            rec.SetSqlInt32(0, status);
            rec.SetSqlString(1, substatus);

            pipe.SendResultsRow(rec);
            pipe.SendResultsEnd();

        }