datareader 从数据库过滤器读取数据并显示在文本框中
嗨,朋友,我有一个带有一个组合框和文本框的表单,另一方面,我有一个
名为balance的sql数据库,有两列,一列作为客户名,另一列作为obbalance,现在我已经
将所有客户名称绑定到组合框,现在我必须做什么是 wen 用户从组合框中选择一个
客户名称,文本框应该显示所选客户名称的平衡
,你能帮我吗......请将代码发送给我
Hi Friend i have a form with one combobox and textbox now on other hand i have a sql database
named balance with two column one as customername and and another as obbalance now i had
binded all the customer name to the combobox now what i have to do is wen user selects a
customername from the combobox the textbox should show the obbalance of the selected
customername can u help me out ........send me the code plz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题不太清楚,但我会尝试一下。这假设您使用的是 SQL 数据库,并且客户名在余额表中是唯一的。
您需要将“YourConnectionString”替换为特定于您的数据库的真实连接字符串。将“CustomerNameFromTextBox”替换为在客户文本框中选择的名称。您可能还需要更改 obbalance 的数据类型和 @customername 参数以匹配数据库中的数据类型。
Your question isn't very clear, but I'll give it a shot. This assumes you are using an SQL database and that customername is unique in the balance table.
You need to replace "YourConnectionString" with a real connection string that will be specific to your database. Replace "CustomerNameFromTextBox" with the name that was selected in your customer text box. You will probably also need to change the data types for obbalance and the @customername parameter to match the data types in your database.