Using Dataset without Binding to Textbox

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
 
T

Trygve Lorentzen

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";

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top