C#读/写Access DB文件(C# Read/Write into Access DB File)
我想使用C#应用程序写入Access数据库文件,可能使用WPF ...我也希望文件受密码保护...是否可以在密码保护时连接到它或者我应该删除密码?
I want to write into Access Database File using C# Application, probably using WPF ... I also want the file to be password protected ... is it possible to connect to it while it is password protected or should I remove the password?
原文:https://stackoverflow.com/questions/3228478
最满意答案
一些想法,虽然不一定完整(你的问题有很多,但希望这些要点有帮助):
我认为您不需要跟踪剩余的交货情况。 您只有2个选项 - 一次性订单或定期订单。 在这两种情况下,计算剩余交货都没有意义。 它永远不会被利用。
在跟踪下一个交货日期方面,您可以跟踪订单的当天。 如果它是经常性的 - 每月或每周,无论如何 - 一切都可以从第一次开始算起。 大多数数据库系统(MySQL,SQL Server,Oracle等)都支持足够的日期计算灵活性,因此您可以动态计算,而不是维护这样一个已知的计划。
如果交货地点仅限于订单,我认为没有必要为它创建一个单独的表 - 它在功能上取决于订单,您应该将它与订单保持在同一个表中。 对于大多数电子商务系统而言,情况并非如此,因为他们倾向于将交付地点列表与帐户相关联,这些帐户会在您多次订购时提示您(例如,亚马逊)。
考虑到上述情况,我打赌你可以在上面的4个表中找到2个 - 账户和订单。 但同样,如果交付地点与账户相关联,我的确会打破这一点。 (但你上面的问题并没有暗示)
不要用“_test”后缀命名你的表 - 这很令人困惑。
A few thoughts, though not necessarily complete (there's a lot to your question, but hopefully these points help):
I don't think you need to keep track of remaining deliveries. You only have 2 options - a one time order, or a recurring order. In both cases, there's no sense in calculating remaining deliveries. It's never leveraged.
In terms of tracking the next delivery date, you can just keep track of the day of the order. If it's recurring -- monthly or weekly, regardless -- everything is calculable from that first date. Most DB systems (MySQL, SQL Server, Oracle, etc) support more than enough date computation flexibility so that you can calculate this on the fly, as opposed to maintaining such a known schedule.
If the delivery location is only specific to the order, I see no use in creating a separate table for it -- it's functionally dependent on the order, you should keep it in the same table as the order. For most e-commerce systems, this is not the case because they tend to associate a list of delivery locations with accounts, which they prompt you about when you order more than once (e.g., Amazon).
Given the above, I bet you can just get away with 2 of your 4 tables above -- Account and Order. But again, if delivery locations are associated with Accounts, I would indeed break that out. (but your question above doesn't suggest that)
Do not name your tables with a "_test" suffix -- it's confusing.
相关问答
更多-
从所有订单状态均为“错误”的订单中选择用户(Selecting users from orders where all orders has the state “errored”)[2021-08-22]
我的SQL不是以前的版本,但我相信对于纯粹的SQL解决方案,它需要看起来像这样: SELECT "users".* FROM "users" LEFT JOIN orders on orders.user_id = users.id LEFT JOIN orders non_errored_orders on non_errored_orders.user_id = users.id and non_errored_orders.state <> 'errored' WHERE "non_ ... -
我终于解决了这个问题: List
orders = RemoteServiceFactory.getOrderRemoteService().list(); for (Order order : orders) { Order orderInfo = RemoteServiceFactory.getOrderRemoteService().getById(order.getId()); List items = orderInfo.getItems(); ... -
在管理面板的WooCommerce订单部分隐藏“免费”订单(Hide “free” orders in WooCommerce orders section from admin panel)[2022-12-20]
您可以使用带有$pagenow全局变量的parse_query过滤器来删除Free命令。 add_filter('parse_query', 'wh_alterAdminPostList'); function wh_alterAdminPostList($query) { global $pagenow; if (is_admin() && $pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] ... -
private static readonly Object obj = new Object(); lock (obj) { ..... } 这有效! 谢谢。 private static readonly Object obj = new Object(); lock (obj) { ..... } This works! Thanks.
-
重复订单(Recurring Orders)[2022-10-21]
一些想法,虽然不一定完整(你的问题有很多,但希望这些要点有帮助): 我认为您不需要跟踪剩余的交货情况。 您只有2个选项 - 一次性订单或定期订单。 在这两种情况下,计算剩余交货都没有意义。 它永远不会被利用。 在跟踪下一个交货日期方面,您可以跟踪订单的当天。 如果它是经常性的 - 每月或每周,无论如何 - 一切都可以从第一次开始算起。 大多数数据库系统(MySQL,SQL Server,Oracle等)都支持足够的日期计算灵活性,因此您可以动态计算,而不是维护这样一个已知的计划。 如果交货地点仅限于订单,我 ... -
Rails:购买与订单(Rails: Purchases vs Orders)[2022-08-14]
好。 你需要完全重新考虑这一点。 您应该有一个单独的表格,以便您可以获得更详细的信息。 应该有一个表格: 订单 - 带有order_id,订单的时间/日期戳,买家是谁,卖家是谁,付款方式是什么,产品是什么,价格是多少 买家 - 在订单中引用。 在这里,您可以找到每位买家的所有相关信息。 以这种方式,买方是否是注册用户并不重要,因为将有两个字段:buyer_id和user_id。 如果买方不是注册用户......则该字段将为空白。 然后您将获得该买家购买的参考,其余大部分将在订单中找到 卖家 - 卖家,当然, ... -
如何统计0个订单?(How to count 0 orders?)[2024-02-18]
从Employees加入Orders并使用左连接而不是内部(或者在编写时仍然从Orders到Employees - 但在这种情况下使用右连接)。 还删除having count(Orders.OrderID) >= 0; 多余的条件(我无法想象你的场景中的负数计数): select Employees.FirstName, count(Orders.OrderID) as "Amount of Orders" from Employees left outer join Orde ... -
亚马逊MWS API:我们下载订单时会丢失一些订单(Amazon MWS API: Some orders are missing when we download orders)[2022-01-06]
通过ListOrders获取订单似乎有许多陷阱。 以下是MWS支持人员的回复, 请注意,只有在清除了一些内部检查(主要是欺诈性订单)时,订单才会填充在ListOrders数据中。 这意味着在创建订单之间以及在API查询中显示订单时(或者在SellerCentral中,就此而言)会有延迟。 这种延迟通常是几分钟,偶尔半小时, 很少是几个小时 。 并且一些订单可以很快从待处理状态转移到未处理状态。 订单ID ---仅处于挂起状态7秒,您所做的所有请求都是在此订单实际可用于在ListOrders中填充API之前。 ... -
您正在寻找提供给多个用户的IP? 然后按IP分组并统计不同的用户。 select ip from mytable group by ip having count(distinct user_id) > 1; 编辑:获取与之关联的用户 select user_id, ip from mytable where ip in ( select ip from mytable group by ip having count(distinct user_id) > 1 ); 这与EXISTS条 ...
-
你应该像这样链接你的发现,然后用户只能看到他/她自己的订单。 def show @food_order = @client.food_orders.find_by(id: params[:id]) redirect_to root_path if @food_order.nil? end You should chain your finds like this, then the user can only see his/her own orders. def show @food_or ...