謝謝你們,
我解決了這個問題。
我從
SELECT transactions.transaction_id, transactions.transaction_amound, CONVERT(char(10), transactions.transaction_date, 103) AS transaction_date,
transaction_type.type_name, transaction_type.description, accounts.account_name, accounts.user_id
FROM transactions INNER JOIN
transaction_type ON transactions.type_id = transaction_type.type_id INNER JOIN
accounts ON transactions.account_id = accounts.account_id
WHERE (accounts.user_id = @UserId)
改變了DB查詢要
SELECT transactions.transaction_id, transactions.transaction_amound, transactions.transaction_date, transaction_type.type_name,
transaction_type.description, accounts.account_name, accounts.user_id
FROM transactions INNER JOIN
transaction_type ON transactions.type_id = transaction_type.type_id INNER JOIN
accounts ON transactions.account_id = accounts.account_id
WHERE (accounts.user_id = @UserId)
和
private void ConstraintChanged()
{
String filter = String.Format(@"account_name LIKE '{0}*' AND type_name='{2}' " +
@"AND Convert(transaction_date, System.DateTime) > '{1}' OR is_edited ='true' ",
this.accountName,
this.dateTimePickerTransactionFrom.Value,
this.radioButtonDebit.Checked ? "Debit" : "Credit");
transactionsAll.DefaultView.RowFilter = filter;
DefaultView_ListChanged();
}
怎麼看起來像this.dateTimePickerTransactionFrom.Value?你可以分享嗎? –
你的意思是問題出在transaction_date? – matzone
dateTimePickerTransactionFrom.Value是typeOf(DateTime), –