(UWP)C#为项目添加数据源 [英] (UWP) C# Adding a Data Source for project

查看:251
本文介绍了(UWP)C#为项目添加数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows窗体中,我使用数据库等创建了一个登录程序。从.NET Standard 2.0开始,我就可以使用System.Data.SqlClient了,我开始在UWP中重新构建应用程序。我创建了数据库,现在我正在尝试创建数据源。在WinForm
项目中,您转到顶部菜单栏上的项目选项卡,然后执行数据源配置向导。我似乎无法在UWP应用程序中找到它。任何想法? 

In Windows Forms, I created a Login Program with a database, etc. Since .NET Standard 2.0 I'm able to use the System.Data.SqlClient and I started remaking the application in UWP. I created the database, and I am now trying to create a data source. In WinForm projects, you go to the project tab on the top menu bar, and do the Data Source Configuration Wizard. I can't seem to find this in a UWP application. Any ideas? 

推荐答案

我认为你指的是所谓的"类型化数据库"。或"TableAdapters"。它们是旧技术,因此您不会为UWP找到它们。您必须自己编写所有数据库内容,或者必须了解实体框架。

I think you are referring to what are also called "Typed Databases" or "TableAdapters". They are old technology, so you won't find them for UWP. You must either write all the database stuff yourself or you must learn about Entity Framework.

当我们使用实体框架时,我们所做的是将模型添加到项目中。 EF的一个优点是它更灵活,更强大。它也比TableAdapters更好地记录。

When we use Entity Framework what we do is to add a model to our project. An advantage of EF is that it is more flexible and powerful. It is also documented better than TableAdapters.

请同时参见
发布指南:主题行标签 。正如你所说的那样,对你这里的人来说非常重要。

Please also see Guide to posting: subject line tags. It is really important to people around here that you do as that says.


这篇关于(UWP)C#为项目添加数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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