Exemplo n.º 1
0
        //slect*
        //modify all
        //insert all
        //delete


        public string GetSuso()
        {
            List <Suso> res = new List <Suso>();

            dal.OpenConn();
            SqlDataAdapter adp      = new SqlDataAdapter("select [TrackName],[Path]  from [Track]", dal.OpenConn());
            DataSet        ds       = new DataSet();
            int            affected = adp.Fill(ds);

            dal.CloseConn();
            for (int i = 0; i < affected; i++)
            {
                Suso suso = new Suso();
                suso.TrackName = ds.Tables[0].Rows[i].ItemArray[0].ToString();
                suso.TrackPath = ds.Tables[0].Rows[i].ItemArray[1].ToString();
                res.Add(suso);
            }
            var jstring = JsonConvert.SerializeObject(res);

            return(jstring);
        }
Exemplo n.º 2
0
        //slect*
        //modify all
        //insert all
        //delete
        public string GetSuso()
        {
            List<Suso> res = new List<Suso>();
            dal.OpenConn();
            SqlDataAdapter adp = new SqlDataAdapter("select [TrackName],[Path]  from [Track]", dal.OpenConn());
            DataSet ds = new DataSet();
            int affected = adp.Fill(ds);
            dal.CloseConn();
            for (int i = 0; i < affected; i++)
            {
                Suso suso = new Suso();
                suso.TrackName = ds.Tables[0].Rows[i].ItemArray[0].ToString();
                suso.TrackPath = ds.Tables[0].Rows[i].ItemArray[1].ToString();
                res.Add(suso);
            }
            var jstring = JsonConvert.SerializeObject(res);

            return jstring;
        }