1 Star 0 Fork 16

tianyayouge/称重软件系统过磅汽车衡车牌识别停车门禁智慧城市共享地磅公磅收费

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SQLDataAccess.cs 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
温暖 提交于 2023-04-14 01:50 . LPR
using Dapper;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LPR
{
public class SQLDataAccess
{
private static readonly string db = ((AppSettingsSection)ConfigurationManager.OpenExeConfiguration("双髻鲨汽车衡称重软件.exe").GetSection("appSettings")).Settings["DBSelect"].Value;
#region CarLabelModel
public static CarLabelModel LoadCarLabel(string labelNo)
{
IDbConnection cnn;
if (db == "mysql")
cnn = new MySqlConnection(LoadConnectionString("AWSMYSQL"));
else
cnn = new SQLiteConnection(LoadConnectionString());
var output = cnn.QueryFirstOrDefault<CarLabelModel>("select * from CarLabel where LabelNo = '" + labelNo + "';", new DynamicParameters());
cnn.Close();
return output;
}
#endregion
private static string LoadConnectionString(string id = "AWSDB") => ConfigurationManager.ConnectionStrings[id].ConnectionString;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/tianyayouge/miaojialing.git
git@gitee.com:tianyayouge/miaojialing.git
tianyayouge
miaojialing
称重软件系统过磅汽车衡车牌识别停车门禁智慧城市共享地磅公磅收费
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385