简体   繁体   English

将 Xamarin.form 与 SQL 服务器连接

[英]Connecting a Xamarin.form with SQL Server

It is the first mobile application that I have worked on.这是我开发的第一个移动应用程序。

I created the database from (New Items - data - services-based database).我从(新项目-数据-基于服务的数据库)创建了数据库。

How to connect the data with the app, and what file should I put connection string ?如何将数据与应用程序连接,我应该将连接字符串放在什么文件 and is it in separate file one for IOS, and one for Andriod?它是否在单独的文件中,一个用于 IOS,一个用于 Andriod?

Second question:第二个问题:

When I create the database it looks like this:当我创建数据库时,它看起来像这样:

我创建的数据库

But when I search about connecting I found something like this >>>但是当我搜索连接时,我发现了这样的东西>>>

namespace XamarinSQL.Clases
{
    public class User
    {
        public int ID { get; set; }
        public string Name{ get; set; }
        public string Password{ get; set; }
    }
}

What is the relationship between two ways and how can I keep up with between them?两种方式之间有什么关系,我该如何跟上它们之间的关系?

You should use an API server that interacts with SQL server and mobile app should consume the REST APIs您应该使用与 SQL 服务器交互的 API 服务器,并且移动应用程序应该使用 REST API

Documentation 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM