using System;
using CustomerOrdersTableAdapters;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack)
        {
            GetCustomerOrders(TextBox1.Text);
        }
    }

    protected void GetCustomerOrders(string custId)
    {
        CustomerOrders myDataSet = new CustomerOrders();
        CustomersTableAdapter custDA = new CustomersTableAdapter();
        OrdersTableAdapter ordersDA = new OrdersTableAdapter();

        custDA.Fill(myDataSet.Customers, custId);
        ordersDA.Fill(myDataSet.Orders, custId);

        myDataSet.Customers[0].Phone = "BRAK";
        myDataSet.Customers[0].Fax = "BRAK";

        GridView1.DataSource = myDataSet.Tables["Customers"];
        GridView1.DataBind();

        GridView2.DataSource = myDataSet.Tables["Orders"];
        GridView2.DataBind();
    }
}
