mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update demo
This commit is contained in:
parent
6d26feb6fa
commit
f2ace4336c
@ -10,11 +10,24 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
|
|
||||||
var db = DbHelper.GetNewDb();
|
var db = DbHelper.GetNewDb();
|
||||||
db.Open();
|
db.BeginTran();
|
||||||
db.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var XX= db.Ado.SqlQuery<DbTableInfo>("Select TABLE_NAME as Name,TABLE_COMMENT as Description from information_schema.tables\r\n where TABLE_SCHEMA=(select database()) AND TABLE_TYPE='BASE TABLE'");
|
||||||
|
db.CommitTran();
|
||||||
|
db.BeginTran();
|
||||||
|
|
||||||
|
var XX2 = db.Ado.SqlQuery<DbTableInfo>("Select TABLE_NAME as Name,TABLE_COMMENT as Description from information_schema.tables\r\n where TABLE_SCHEMA=(select database()) AND TABLE_TYPE='BASE TABLE'");
|
||||||
|
db.CommitTran();
|
||||||
|
db.CodeFirst.InitTables<Student11>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class Student11
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(IsPrimaryKey = true )]
|
||||||
|
public int Id { get; set; } // 学生ID (Student ID)
|
||||||
|
public string Name { get; set; } // 学生姓名 (Student Name)
|
||||||
|
public int Age { get; set; } // 学生年龄 (Student Age)
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper class for database operations
|
/// Helper class for database operations
|
||||||
@ -26,7 +39,7 @@ namespace OrmTest
|
|||||||
/// Database connection string
|
/// Database connection string
|
||||||
/// 数据库连接字符串
|
/// 数据库连接字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly static string Connection = "data source=139.170.74.9;port=9030;database=test;user id=root;password=1q!1q!;pooling=true;charset=utf8;";
|
public readonly static string Connection = "data source=139.170.74.9;port=9030;database=test;user id=root;password=1q!1q!;pooling=true;charset=utf8;Pooling=false";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a new SqlSugarClient instance with specific configurations
|
/// Get a new SqlSugarClient instance with specific configurations
|
||||||
|
Loading…
Reference in New Issue
Block a user