问题描述
我创建了一个包含7个表的sql数据库。
bankacc
cashpay
客户
opening_balance
付款
receievedchq
提款
并为客户,银行和付款创建三种表格。
bankacc表:bankid,bankname,branchname,accname,accountno
客户表:custid,custname,custadd,tpno
付款表:paymentid ,paymentdate,custname,description,chqno,duedate,accname,amount
付款表单有两个用于custname和accname的组合框
custname组合应该连接到:customer table custname
accname combo应该连接到:bankacc table accname
并希望通过这一切记录到数据库中的付款表。我是c#的新手。任何人都可以帮忙编码。
i've created a sql database contains 7 tables.
bankacc
cashpay
customer
opening_balance
payment
receievedchq
withdrawal
and also create three forms for customer, bankacc and payments.
bankacc table : bankid,bankname,branchname,accname,accountno
customer table : custid,custname,custadd,tpno
payments table : paymentid,paymentdate,custname,description,chqno,duedate,accname,amount
in payments forms there are two combo boxes for custname and accname
custname combo should be connected to : customer table custname
accname combo should be connected to : bankacc table accname
and want to pass this all record to payments table in database. I am new to c#. can anyone help with coding.
推荐答案
ddlcustname.SelectedItem.Text or ddlcustname.SelectedItem.ToString()
和
and
ddlaccname.SelectedItem.Text or ddlaccname.SelectedItem.ToString()
一个建议
如果你的 custname 和 accname 是可编辑的,那么你应该在PaymentTable中使用CustId和AccId来保证数据准确性
如果适用则忽略在您的情况下
One Suggestion
If your custname and accname are editable then you should take CustId and AccId in PaymentTable for data accuracy
Ignore if it's applicable in your case
这篇关于C#组合框数据未在sql server数据库表中更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!