You can use a column like (Hijri_Date varchar (10)), and it will be easy to save and easily create reports and queries between two dates. C # asp.net uses the following steps:
1- Add a script manager to your web form. and set the property EnableScriptGlobalization = true, EnableScriptLocalization = true
2- Add a HijriDate text box.
3- Add button to select Hijra date.
4- Add CalendarExtender from Ajaxtoolbox and add the following properties, for example PopupButtonID = "btnDate" TargetControlID = "txtapptdate".
5- Change the format property for CalendarExtender to dd / MM / yyyy.
6- change the property for a read-only text field = true.
7- Add the following culture values ββto your home page in html to convert the calendar from a Gregorian date to a hijri date: UICulture = "ar" Culture = "ar-SA".
8- When you save and paste the date into the SQL server, you can use the value as usual Hijri_Date.Text
9-, to compare later and create a filter and search screen or reports, and if you need to find entries between two dates, use the format function to change the DATE output format, and the convert function to convert varchar to date in the select statement, for example like this :
select format(cast(Hijri_date as date),'dd/MM/yyyy','ar-sa') from Table1 where Hijri_date between '10/05/1439' and '20/10/1439'
source share