数据集中的Databind组件到表

时间:2013-07-09 07:06:49

标签: c# sql-server-2008

我创建了一个方法,用数据源对表进行数据绑定。:

private void AddDataBinding()
    {
        txtID.DataBindings.Add("Text", ds, "Ticket.RaffleID");
        cboName.DataBindings.Add("Value", ds, "Ticket.CustomerID");
        dtpDate.DataBindings.Add("Value", ds, "Ticket.Date");
        txtStore.DataBindings.Add("Text", ds, "Ticket.Store");
        txtAmount.DataBindings.Add("Text", ds, "Ticket.Amount");
        txtStub.DataBindings.Add("Text", ds, "Ticket.NoStub");

        cm = (CurrencyManager)this.BindingContext[ds, "Ticket"];
    }

private void frmCustomerTicket_Load(object sender, EventArgs e)
    {
        OpenConnection();
        AddDataBinding();
    }

当我运行代码时,此消息显示:“无法创建字段故障单的子列表。”

0 个答案:

没有答案