You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class TableSample {
[Column(IsIdentity = false, IsPrimary = true)]
public int Id { get; set; }
public DateTime TimeStamp { get; set; }
}
var fsql= new FreeSql.FreeSqlBuilder()...
var formatDate = fsql.Ado.QuerySingle<string>("SELECT r.date_format FROM master.sys.dm_exec_requests r WHERE r.session_id = @@SPID");
// formatDate = "dmy"
int id = 1;
var sql = fsqlSage.Update<TableSample>(id).Set(x => x.TimeStamp, DateTime.Today).ToSql();
// sql= "UPDATE [TableSample] SET [TimeStamp] = '**2024-07-30** 00:00:00.000' WHERE ([Id] = 1)"
// SqlException: convert varchar to datetime.
// correct: "UPDATE [TableSample] SET [TimeStamp] = '**30-07-2024** 00:00:00.000' WHERE ([Id] = 1)"
Database version
SQLEXPRESS 15.0.20000
Nuget
FreeSql.All 3.2.832
.net framework/.net core? y versión específica
.Net 8.0
The text was updated successfully, but these errors were encountered:
Problem description and reproducible code:
Format datetime error
Database version
SQLEXPRESS 15.0.20000
Nuget
FreeSql.All 3.2.832
.net framework/.net core? y versión específica
.Net 8.0
The text was updated successfully, but these errors were encountered: