Article From:

UbuntuVersion: 16.0.4
.net coreVersion: 1.1
Wrote a test case and found that the console procedure is the same.
The program uses the sqlSugarCore component to access the database

The question now is:
It can connect to the remote database in window, but Linux can’t do it.
Sqlserver access that can be normally accessed in LAN in Linux

sudo service ufw stop The firewall doesn’t seem to have anything to do with it.

So it is doubted whether Linux needs to be set up to connect to sqlserver service.

Find this issues: in GitHub…
It seems to say the 1.1 solution. But my name is 1.1~~

Test code


using System;
using SqlSugar;

namespace mssqlCoreDemo
    class Program
        //LinuxLower remote database link failurePublic const string ConnectionString = "server= remote SQLSERVER database; database=test; uid=s"A; pwd=123456 ";Static void Main (string[] args){Console.WriteLIne ("start");Using (VaR DB = new SqlSugarClient (New ConnectionConfig ()) {ConnectionStrIng = ConnectionString, DbType = DbType.SqlServer}){Console.WriteLinE ("Connect Database:" +db.Ado.GetScalar ("select 233").ToString ());}Console.WriteLine ("end");}}}


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Project Sdk="Microsoft.NET.Sdk">
    <PackageReference Include="sqlSugarCore" Version="" />

The exception log after the link timeout is as follows

Answer 0:

.net core The program connects to SQLSERVER database under Linux, and the SqlServer version must be larger than SQL Server 2008 SP4.

Leave a Reply

Your email address will not be published. Required fields are marked *