Skip to main content

Posts

Showing posts from 2023

Convert Time Between Time Zones in SQL Server

Step 1  Get a list of Time Zones SELECT * FROM sys.time_zone_info  Step 2 Run a Conversion  SELECT GETDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'AUS Eastern Standard Time'; The above script essentially tells SQL Server that the datetime is UTC and you want it as Australian time.  This approach is needed when the date time includes no time zone info The text you enter for the time zone name needs to match the entry in the sys.time_zone_info table.  Information from  AT TIME ZONE (Transact-SQL) - SQL Server | Microsoft Learn

How to Sign a C# .Net WPF Application

  To sign a C# WPF .NET 6 application, you can follow these steps: Generate a strong name key pair: Open the Developer Command Prompt for Visual Studio (search for it in the Start menu). Navigate to the project directory using the cd command. Run the following command to generate a strong name key pair: Copy code sn -k keypair.snk Configure your project to use the strong name key pair: In Visual Studio (prior to 2022), open your WPF project. Right-click on the project in the Solution Explorer and select "Properties." In the project properties, go to the "Signing" tab. Check the "Sign the assembly" checkbox. Click the "..." button next to the "Choose a strong name key file" field and browse to select the keypair.snk file you generated in the previous step. Click "OK" to save the changes. Configure the project for ClickOnce deployment (optional but recommended for distributing your application): In the project properties, go t

Syncfusion Grid, Custom Add Dialog - Two methods

 Method 1 - Using the default Options - ToolbarClickHandler In the Razor Page @{ var Toolbar = new List < string > () { "Add" , "Search" }; } < SfGrid DataSource =" @ Organisations " TValue =" OrganisationList " Toolbar =" @ Toolbar " AllowSelection ="true" AllowPaging ="true" AllowSorting ="true" > < GridEditSettings AllowAdding ="true" Mode =" EditMode . Dialog " > <Template > @{ var org = ( context as OrganisationList ); } Your own code here for the dialog </ GridEditSettings > < GridPageSettings PageSize ="20" ></ GridPageSettings > < GridEvents OnToolbarClick =" ToolbarClickHandler " TValue =" OrganisationList " > </ GridEvents > Inside the Grid In the code: public async Task ToolbarClickHandler (