Пример #1
0
        public static int ToZoho(string sql)
        {
            const string connectionString = "security token=fe85458c694b2c124e2c161f8e2b834b;";
            int          result           = 0;

            using (ZohoConnection connection = new ZohoConnection(connectionString))
            {
                connection.Open();
                using (ZohoCommand command = connection.CreateCommand())
                {
                    command.CommandText = sql;
                    result = command.ExecuteNonQuery();
                }
            }
            return(result);
        }
Пример #2
0
        private static DataTable GetInfo(string sql)
        {
            const string connectionString = "security token=fe85458c694b2c124e2c161f8e2b834b;";
            DataTable    dt = new DataTable();

            using (ZohoConnection connection = new ZohoConnection(connectionString))
            {
                connection.Open();
                using (ZohoCommand command = connection.CreateCommand())
                {
                    command.CommandText = sql;
                    using (ZohoDataAdapter adapter = new ZohoDataAdapter(command))
                    {
                        adapter.Fill(dt);
                    }
                }
            }
            return(dt);
        }
Пример #3
0
        public static DataTable GetDtByOwnID(string OwnID)
        {
            const string connectionString = "security token=fe85458c694b2c124e2c161f8e2b834b;";
            //const string sql = "SELECT * FROM Contacts";
            DataTable dt = new DataTable();

            using (ZohoConnection connection = new ZohoConnection(connectionString))
            {
                connection.Open();
                using (ZohoCommand command = connection.CreateCommand())
                {
                    command.CommandText = $"select CONTACTID,Email from Contacts where SMOWNERID=" + OwnID.Replace("\"", "");
                    using (ZohoDataAdapter adapter = new ZohoDataAdapter(command))
                    {
                        adapter.Fill(dt);
                    }
                }
            }
            return(dt);
        }