chore: initial commit
This commit is contained in:
40
Interface_WebAPI/DatabaseClient/Program.cs
Normal file
40
Interface_WebAPI/DatabaseClient/Program.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DatabaseClient
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
// TestSqlite();
|
||||
TestMysql();
|
||||
//TestMssql();
|
||||
Console.ReadKey();
|
||||
}
|
||||
static void TestSqlite()
|
||||
{
|
||||
var sqlClient = new DBClientFactory("Sqlite").Create();
|
||||
sqlClient.Connect("Data Source=mytest.sqlite;Version=3;");
|
||||
var ds = sqlClient.ExecQuery("select * from Z_Save_Position");
|
||||
}
|
||||
static void TestMysql()
|
||||
{
|
||||
var sqlClient = new DBClientFactory("Mysql").Create();
|
||||
sqlClient.Connect("server=192.168.1.204;port=33060;database=zkeco;username=mesuser;password=Mes147258;");
|
||||
var ds = sqlClient.ExecQuery("select * from vw_mes_userinfo;");
|
||||
}
|
||||
|
||||
static void TestMssql()
|
||||
{
|
||||
var sqlClient = new DBClientFactory("Mssql").Create();
|
||||
|
||||
sqlClient.Connect(@"server=.\WINCC;database=MW_DataFactory_App_Add;uid=sa;pwd=126.com;Connection Reset=FALSE;Max Pool Size = 1000");
|
||||
var ds = sqlClient.ExecQuery("select * from ProjectList");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user