1.nuget安装对应包
2.winform里使用
2.1配置连接字符串
<appSettings>
<add key="db" value="Server=ip:5236;Database=Db1;User Id=root;Password=xxx" />
</appSettings>
2.2使用
static IFreeSql fsql;
private void Form2_Load(object sender, EventArgs e)
{
var db=ConfigurationManager.AppSettings.Get("db");
fsql = new FreeSql.FreeSqlBuilder()
.UseConnectionString(FreeSql.DataType.Dameng, db)
.UseAutoSyncStructure(false)
.UseNameConvert(FreeSql.Internal.NameConvertType.None)
.Build();
var user=fsql.Queryable<User>().First();
}
public class User
{
[Column(IsPrimary =true,IsIdentity =true)]
public int Id { get; set; }
public string Name { get; set; }
}
更多增删改查操作参加官方博客:
https://www.cnblogs.com/zhizhengzhaoxi/articles/16525191.html
标签:FreeSql,db,达梦,freesql,true,public,fsql,winform From: https://www.cnblogs.com/xuejianxiyang/p/16758315.html