예제 #1
0
        public DataSet getPlace(string sql)
        {
            DataSet ds;

            ds = db.GetDataSet(sql);
            return(ds);
        }
예제 #2
0
        public DataSet getPlaceInfo(string sql)
        {
            DataSet ds = new DataSet();

            ds = db.GetDataSet(sql);
            return(ds);
        }
예제 #3
0
        //注册用户
        public void Register(Users u)
        {
            string  sql = "select top 1 * from Users";
            DataSet ds  = db.GetDataSet(sql);
            DataRow dr  = ds.Tables[0].NewRow();

            dr["Username"] = u.Username;
            dr["Password"] = u.Password;
            dr["Sex"]      = u.Sex;
            dr["RoleId"]   = u.RoleId;

            dr["Email"] = u.Email;
            ds.Tables[0].Rows.Add(dr);
            db.UpdateDataset(sql, ds);
        }
예제 #4
0
        //定义一个方法,根据父类别id得到其所有的子类别
        public DataSet getCategoryByParentId(int parentid)
        {
            string  sql = "select * from category where parentid=" + parentid;
            DataSet ds  = db.GetDataSet(sql);

            return(ds);
        }