protected void linkEdit(object sender, CommandEventArgs e) { // long ID = long.Parse(Request.QueryString["Day_Label"]); long ID = long.Parse(e.CommandArgument.ToString()); CommonClassLibrary.CommonDataSet.TextMessageDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.TextMessageTableAdapter().GetDataById(ID); foreach (CommonClassLibrary.CommonDataSet.TextMessageRow item in collection) { this.Name_TextBox.Text = item.Id.ToString(); this.EditName_TextBox.Text = item.Thai; this.EditNameEN_TextBox.Text = item.English; } EditPanel.Visible = true; AddPanel.Visible = false; ShowPanel.Visible = false; }
public void getdata() { DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("NameTH"); dt.Columns.Add("NameEN"); CommonClassLibrary.CommonDataSet.TextMessageDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.TextMessageTableAdapter().GetData(); foreach (CommonClassLibrary.CommonDataSet.TextMessageRow item in collection) { dt.Rows.Add(item.Id, item.Thai, item.English); } this.TicketOrderRepeater.DataSource = dt; this.TicketOrderRepeater.DataBind(); }