C# How can I determine the properties of a class member


I have created a class that will be used to store the data from a SQLite database. I want to be able to check if the database exists (create it if it doesn’t), then check if the Table exists (create it if it doesn’t). I can do this. Next, I want to be able to work through my class and determine if the columns exist and then create the columns if they don’t exist.

The class is as follows:

class SageDataCustomer
    {
        public int ACCOUNT_ON_HOLD { get; set; }

        public string ACCOUNT_REF { get; set; }

        public string ADDRESS_1 { get; set; }

        public string ADDRESS_2 { get; set; }

        public string ADDRESS_3 { get; set; }

        public string ADDRESS_4 { get; set; }

        public string ADDRESS_5 { get; set; }

        public string ANALYSIS_1 { get; set; }

        public string ANALYSIS_2 { get; set; }

        public string ANALYSIS_3 { get; set; }

        public decimal AVERAGE_PAY_DAYS { get; set; }

... etc
}

How can I get the name of the member e.g. AVERAGE_PAY_DAYS and the type of the member e.g. decimal?

public static void RefreshSageData(string sageOdbcConnection, string accountingDataPath)
        {
            if (!File.Exists(accountingDataPath))
            {
                //Create the database
                SQLiteConnection.CreateFile(accountingDataPath);
            }

            //Open the database
            SQLiteConnection conn = new SQLiteConnection($"Data Source={accountingDataPath}");
            conn.Open();
            using (SQLiteCommand cmd = new SQLiteCommand(conn))
            {
                cmd.CommandText = "CREATE TABLE IF NOT EXISTS 'sales' ( 'IX' INTEGER NOT NULL UNIQUE, PRIMARY KEY('IX' AUTOINCREMENT))";
                cmd.ExecuteNonQuery();
                cmd.CommandText = "CREATE TABLE IF NOT EXISTS 'purchase' ( 'IX' INTEGER NOT NULL UNIQUE, PRIMARY KEY('IX' AUTOINCREMENT)) ";
                cmd.ExecuteNonQuery();
                cmd.CommandText = "CREATE TABLE IF NOT EXISTS 'nominal' ( 'IX' INTEGER NOT NULL UNIQUE, PRIMARY KEY('IX' AUTOINCREMENT))";
                cmd.ExecuteNonQuery();
            }

            SageDataCustomer sageDataCustomer = new SageDataCustomer();
            MemberInfo() sageMemberInfo;

            Type mType = sageDataCustomer.GetType();
            sageMemberInfo = mType.GetMembers();
            Type type1;

            for (int i = 0; i < sageMemberInfo.Length; i++)
            {
                type1 = sageMemberInfo(i).GetType();
                Debug.Print("'{0}' is a {1} and is a {2}", sageMemberInfo(i).Name, sageMemberInfo(i).MemberType, type1);
            }

            conn.Close();
            conn.Dispose();
}