C#WinForms - 通过实体保存到数据库 [英] C# WinForms - Saving to database via Entity

查看:270
本文介绍了C#WinForms - 通过实体保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!

我正在建立某种客户管理计划,目前正在搁浅。我有两个表,"客户"和"联系人"。在我的WinForm中,我有2个文本框和1个组合框。文本框将分别具有表联系人
的值Name和FirstName,组合框从customers表中选择1个客户,我需要将该客户的ID插入到联系人中。最聪明的方法是什么?我已经尝试了不同的事情已经有一段时间了,并且没有在任何地方获得

I'm building some sort of customer management program and am running aground currently. I have two tables, 'customers' and 'contacts'. In my WinForm I have 2 textboxes and 1 combobox. The textboxes will have the values Name and FirstName for the table contacts respectively and the combobox selects 1 customer from the customers table and I need the ID of that customer to be inserted into contacts aswell. What is the smartest way to do this? I've been trying different things for quite some time now and have not gotten anywhere.

推荐答案

您好,

请用文字或代码表明您尝试过的以及如何创建实体。

Please indicate either in words or code what you have tried and how you created your entities.

正在使用什么版本的EF。

Also what version of EF is being used.


这篇关于C#WinForms - 通过实体保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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