private void mapData(int Id) { DataTable data = item.GetbyId(Id); if (data.Rows.Count > 0) { txtcode.Text = data.Rows[0]["ItemCode"].ToString(); txtname.Text = data.Rows[0]["ItemName"].ToString(); itemId = Convert.ToInt32(data.Rows[0]["Id"].ToString()); btnadd.Text = "&Update"; } }