我的MS Access数据库表包含一些数据。我将该表添加到Winforms Devexpress的DataSet中。检索数据的一列(Amount Paid)获取错误的数据。帮助恢复这个问题。 显示我的MS Access数据库表的第一张图像和显示Winform Devexpress中的DataSet表的第二张图像
这是我用于在MS Access数据库中创建查询表的SQL查询
SELECT InvoiceNumber,
(SELECT PaymentTerms FROM PSD_customerPaymentTerms WHERE PSD_customerPaymentTerms.PTId = NewInvoice_1.Terms) AS Terms,
InvoiceDate,
OurQuote,
(SELECT FirstName FROM Employee WHERE Employee.EmployeeId = NewInvoice_1.SalesPerson) AS SalesPerson,
(SELECT CustomerName FROM Customer WHERE Customer.CustomerId = NewInvoice_1.CustomerName) AS CustomerName,
OrderNumber,
GrandTotal,
(SELECT SUM(PaymentAmount) FROM Payment_Receipt WHERE Payment_Receipt.InvoiceNumber=NewInvoice_1.InvoiceNumber) AS AmountPaid,
GrandTotal-IIf(AmountPaid Is Null,0,AmountPaid) AS AmountDue
FROM NewInvoice_1;
第一张图片
第二张图片
答案 0 :(得分:1)
显然,未正确设置AmountPaid列的绑定。我建议你先检查列的FieldName
属性。如果设置正确,那么您的问题可能是更改单元格文本或某些代码在运行时更改基础数据源中的值的事件。
如果您在那里找不到任何内容,我建议您分享一些代码,以便获得更多帮助。