public void Test_DqlFill_Schema() { string select = "Select * from dm_cabinet enable(return_top 1)"; string cnstr = "User=dmadmin;Password=@vmware99;Repository=ls_repos"; DataSet dataset = new DataSet(); using (var cn = new DqlConnection(cnstr)) { cn.Open(); using (var cmd = new DqlCommand(select, cn)) { using (var adapter = new DqlDataAdapter(cmd)) { adapter.FillSchema(dataset); } } } }
public void Test_DqlFill_RepeatingValues() { string select = "select r_object_id, object_name, keywords, authors from dm_cabinet where not object_name like 'dm%' and object_name = 'ls_repos'"; DataSet dataset = new DataSet(); string cnstr = "User=dmadmin;Password=@vmware99;Repository=ls_repos"; using (DqlConnection cn = new DqlConnection(cnstr)) { cn.Open(); using (DqlCommand cmd = new DqlCommand(select, cn)) { using (DqlDataAdapter adapter = new DqlDataAdapter(cmd)) { var schemas = adapter.FillSchema(dataset, SchemaType.Source); Assert.AreEqual(dataset.Tables[0].Rows[0]["keywords"].ToString(), "test2|test3|test1"); Assert.AreEqual(dataset.Tables[0].Rows[0]["authors"].ToString(), "author2|author3|author1"); } } } }