sql
  • dataset
  • 2013-10-30 68 views 0 likes 
    0

    請參閱代碼如何在描述的情況下執行DataSet的行數組選擇方法?

    DataRow[] rowToUpdate = database1DataSet1.Tables["purchase_invoice"]. 
            Select(string.Format("PuchaseInvoiceId = '{0}' ",cbPurchaseInvoiceId.Text)); 
    
    error' Cannot perform '=' operation on System.Int32 and System.String. 
    

    是否有一個解決辦法。

    回答

    1
    DataRow[] rowToUpdateUpdate = database1DataSet1.Tables["purchase_invoice"].     
          if(cbPurchaseInvoiceId.Text.Trim()!="") 
          Select(string.Format("PuchaseInvoiceId = '{0}' ",cbPurchaseInvoiceId.Text)); 
    

    BindingSource bs = new BindingSource(); 
    bs.DataSource = database1DataSet1.Tables["purchase_invoice"]; 
    private void cbPurchaseInvoiceId_TextChanged(object sender, EventArgs e) 
    { 
        if(cbPurchaseInvoiceId.Text .Trim()!="") 
        bs.Filter = string.Format("PuchaseInvoiceId = '{0}'", int.Parse (txtempname.Text)); 
    } 
    
    相關問題