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); }
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); }