public virtual DataTable add3() { ADOTemplate template = new ADOTemplate(); DataTable table = template.Query("select * from city limit 10", null, null); return(table); }
public virtual DataRow add2() { ADOTemplate template = new ADOTemplate(); DataTable table = template.Query("select * from city", null, null); DataRow row = table.Rows[0]; return(row); }
public virtual void queryCity() { ADOTemplate template = new ADOTemplate(); template.Query("select * from city ", null, null); template.Query("select * from city ", null, null); template.Query("select * from city ", null, null); }
public virtual void add() { ADOTemplate template = new ADOTemplate(); DataTable table = template.Query("select 1 from city where city_id in (@id)", new String[] { "id" }, new Object[] { new int[] { 618, 617 } }); int count1 = table.Rows.Count; template.Execute("insert into city (city_id, city, country_id, last_update) values(@city_id, @city, @country_id, @last_update) ", new string[] { "city_id", "city", "country_id", "last_update" }, new object[] { null, "test city", 19, DateTime.Now }); table = template.Query("select 1 from city", null, null); int count2 = table.Rows.Count; Assert.AreEqual(count1 + 1, count2, "insert new row, rows's total will add one!"); }
public virtual void Insert() { ADOTemplate template = new ADOTemplate(); //template.Insert(); }