hadimtn
یک شنبه 18 بهمن 1394, 21:04 عصر
سلام.
چه جوری میشه هنگام اجرای پرس و جو از تاریخ تبدیل شده استفاده کرد؟!
من به این شکل نوشتم؛
ForoshaLINQDataContext db = new ForoshaLINQDataContext();
PersianCalendar pc = new PersianCalendar();
var CurrentMonthQuery = (from f in db.SaledTables
where pc.GetMonth(f.RegDate) == pc.GetMonth(DateTime.Now)
select f).OrderBy(f => f.Object).ToList();
ReportViewer.DataSource = CurrentMonthQuery;
اما؛
138876
تاریخ با نوع داده ی DateTime (میلادی) ذخیره شده!
چه جوری میشه هنگام اجرای پرس و جو از تاریخ تبدیل شده استفاده کرد؟!
من به این شکل نوشتم؛
ForoshaLINQDataContext db = new ForoshaLINQDataContext();
PersianCalendar pc = new PersianCalendar();
var CurrentMonthQuery = (from f in db.SaledTables
where pc.GetMonth(f.RegDate) == pc.GetMonth(DateTime.Now)
select f).OrderBy(f => f.Object).ToList();
ReportViewer.DataSource = CurrentMonthQuery;
اما؛
138876
تاریخ با نوع داده ی DateTime (میلادی) ذخیره شده!