Paul is an Avid Reader. No contributions for 2024.
Without a doubt, there will be something to
share on the Community in 2025!
User bio

I have extensive knowledge of developing applications and interfaces for Healthcare Information Exchanges using IHE and object oriented application standards. My primary goal is produce systems that are of the highest quality, so that the patient experience is trustworthy and efficient at the point of care. Database integration and performance is my strongest asset.

Show all
Member since May 14, 2019
Posts:
Paul has not published any posts yet.
Replies:

You can convert the DateTime to a Time String and send that in the insert or update strings.

Here is the Cache Class used in my example:

Class User.TestTimeData Extends %Persistent
{

Property TimeFormat As %String [ Required ];

Property TimeTest As %Time [ Required ];
}

Here is the C# .Net Core Console App code example:
using System;
using System.Data.Odbc;

namespace TestCacheTimeType
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            DateTime dateTime = DateTime.MinValue.AddHours(22).AddMinutes(10);

            string timeLong = dateTime.ToLongTimeString();
            InsertRecord("ToLongTimeString", timeLong);

            string timeShort = dateTime.ToShortTimeString();
            InsertRecord("ToShortTimeString", timeShort);

            string timeFormatted = dateTime.ToString("HH:mm:ss");
            InsertRecord("ToString"HH:mm:ss)"", timeFormatted);

            Console.WriteLine("Press any key to exit....");
            Console.Read();
        
        }

        static void InsertRecord(string TimeFormat, string TimeToInsert)
        {
            Console.WriteLine("{0}: {1}", TimeFormat, TimeToInsert);
            using (OdbcConnection connection = new OdbcConnection("DSN=IRISHealth-WebDev; UID=; PWD =; "))
            {
                string insertSQL = "Insert into SQLUser.TestTimeData(TimeFormat, TimeTest) values('" + TimeFormat + "', '" + TimeToInsert + "');";
                // inserts a new row in the source table.
                OdbcCommand command = new OdbcCommand(insertSQL, connection);
                // Open the connection and execute the insert command.
                try
                {
                    connection.Open();
                    command.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

            }

        }
    }
}
Certifications & Credly badges:
Paul has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Paul has no followers yet.
Following:
Paul has not followed anybody yet.