public Task <IList <string> > GetOwners() { IList <string> owners = new List <string>(); var conn = new CUBRIDConnection(connectionStr); conn.Open(); try { using (conn) { var schema = new CUBRIDSchemaProvider(conn); DataTable dt = schema.GetUsers(new[] { "%" }); for (var i = 0; i < dt.Rows.Count; i++) { owners.Add(dt.Rows[i][0].ToString().ToLower()); } } } finally { conn.Close(); } return(Task.FromResult(owners)); }
/// <summary> /// Test CUBRIDSchemaProvider GetUsers() method /// </summary> private static void Test_GetUsers() { using (CUBRIDConnection conn = new CUBRIDConnection()) { conn.ConnectionString = TestCases.connString; conn.Open(); CUBRIDSchemaProvider schema = new CUBRIDSchemaProvider(conn); DataTable dt = schema.GetUsers(null); Debug.Assert(dt.Columns.Count == 1); Debug.Assert(dt.Rows.Count >= 2); Debug.Assert(dt.Rows[0][0].ToString().ToUpper() == "DBA"); Debug.Assert(dt.Rows[1][0].ToString().ToUpper() == "PUBLIC"); } }