对我的项目有疑问 [英] doubt in my project

查看:70
本文介绍了对我的项目有疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sql 2005作为数据库在C#中做一个小项目.据我所知,它已经完成了. .但是,当我添加不在我的库存表中的项目时,它会显示帐单.我该如何避免这个错误.是否有任何命令显示该项目不存在.

I am doing a small project in C# using sql 2005 as database.I done it as my knowledge."but now i have a doubt" .i have a billing form there i select the item to combobox from stock table for billing . but when i add-the item that is not in my stock table it show the billing . how can i avoid this mistake.is there any command that shows the item is not existing.

推荐答案

您可以通过两种方式进行操作-

1)保留所有不在库存表中的物料的集合(通过查询获取它们).每当您进行结算时,请检查该项目是否在列表中.如果不是,则进行计费,否则忽略计费.

2)每次更改组合中的项目时,都要执行查询以检查该项目是否在库存表中.

两者之间的选择取决于您的网络资源/数据库连接等.
You can do this two ways -

1) Keep a collection of all the items that are not in the stock table (by fetching them through a query). Whenever you do a billing, check if this item is in the list. If not, then do the billing else ignore billing.

2) Execute a query to check if the item is in the stock table everytime an item is changed in the combo.

The choice between these two depends on your network resources / database connections etc.


这篇关于对我的项目有疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆