Using Dataset without Binding to Textbox

  • Thread starter Thread starter Atif - Alghanem
  • Start date Start date
A

Atif - Alghanem

hi,
I need to use a dataset without binding to a text box. i need to move value
from dataset to textbox manually. does anyone have any sample for this.

Thanks and regards
atif
 
rowCurrentOrder is a DataRow set to a row of a DataTable of a DataSet like
this:

rowCurrentOrder = dsChapter13.Orders[0];



Sample code below:



if (rowCurrentOrder != null)

{

txtOrderID.Text = rowCurrentOrder.OrderID.ToString();

if (rowCurrentOrder.IsCustomerIDNull())

txtCustomerID.Text = strNull;

else

txtCustomerID.Text = rowCurrentOrder.CustomerID;

if (rowCurrentOrder.IsEmployeeIDNull())

cboEmployee.SelectedIndex = -1;

else

cboEmployee.SelectedValue = rowCurrentOrder.EmployeeID;

if (rowCurrentOrder.IsOrderDateNull())

txtOrderDate.Text = strNull;

else

txtOrderDate.Text = rowCurrentOrder.OrderDate.ToShortDateString();

lblOrdersPosition.Text = "Order " + (intOrderPosition + 1) + " of " +
vueOrders.Count;

vueDetails.RowFilter = "OrderID = " + rowCurrentOrder.OrderID;

}

else

{

txtOrderID.Clear();

txtCustomerID.Clear();

txtOrderDate.Clear();

lblOrdersPosition.Text = "No Orders";

vueDetails.RowFilter = "False";

}
 
Back
Top