The article link given by
Uday P.Singh is good for learning about ADO.NET.
Now, if you have already populated the
DataTables
of your
DataSet
, then to retrieve a
DataRow
corresponding to the ID entered in a
TextBox
the following code can be used.
DataRow row = Employees.Rows.Find(TextBoxID.Text);
if (row != null){
TextBoxName.Text = (string)row["Name"];
TextBoxAddress.Text = (string)row["Address"];
}
DataRow[] rows = Employees.Select(string.Format("EmployeeID='{0}'",
TextBoxID.Text),"",DataViewRowState.CurrentRows);
if (rows.Length > 0){
TextBoxName.Text = (string)rows[0]["Name"];
TextBoxAddress.Text = (string)rows[0]["Address"];
}