myDataRow["id"] = 2;
myDataRow["商品名称"] = "篮球";
myDataRow["商品价格"] =64.5;
myDataTable.Rows.Add(myDataRow);
myDataRow = myDataTable.NewRow();
myDataRow["id"] = 3;
myDataRow["商品名称"] = "网球";
myDataRow["商品价格"] =6.5;
myDataTable.Rows.Add(myDataRow);
myDataRow = myDataTable.NewRow();
myDataRow["id"] = 4;
myDataRow["商品名称"] = "网球拍";
myDataRow["商品价格"] =388.5;
myDataTable.Rows.Add(myDataRow);
//返回数据表
return myDataTable;
}
步骤二:在aspx前台页面中添加一个DataGrid1,在后台代码的Page_Load 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页 |