protected void Page_Load(object sender, EventArgs e) { myButton.InnerText = "yyy"; DataTable dataSet = new MySqlServices().AA(1, 100); GridView1.DataSource = dataSet; GridView1.DataBind(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers().AddNewtonsoftJson(opt => { opt.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; }); services.AddControllers(); MySqlServices.ConfigureServices(services, Configuration); RedisServices.ConfigureServices(services, Configuration); CasoUsoServices.ConfigureServices(services); }
public ArticleCollection GetArticle(string startIndex, string count) { ArticleCollection articles = new ArticleCollection(); DataTable dt = new MySqlServices().AA(Convert.ToInt32(startIndex), Convert.ToInt32(count)); for (int i = 0; i < dt.Rows.Count; i++) { Article article = new Article(); article.Content = dt.Rows[i][0].ToString(); articles.Articles.Add(article); } return(articles); }