示例#1
0
        //检查是否重名
        public bool IsExists(string name)
        {
            bool   flag    = false;
            string cmdText = "select * from member where name=@name";

            SqlParameter[] paras = new SqlParameter[] {
                new SqlParameter("@name", name)
            };
            DataTable dt = sqlhelper.ExecuteQuery(cmdText, paras, CommandType.Text);

            if (dt.Rows.Count > 0)
            {
                flag = true;
            }
            return(flag);
        }
示例#2
0
        //根据歌曲ID取出评论
        public DataTable SelectBySongId(string songId)
        {
            string cmdText = "select id,userId,createTime,[content] from comment where SongId=@songId";

            SqlParameter[] paras = new SqlParameter[] {
                new SqlParameter("@songId", songId)
            };
            DataTable dt = new DataTable();

            dt = sqlhelper.ExecuteQuery(cmdText, paras, CommandType.Text);
            return(dt);
        }