發表文章

目前顯示的是 7月, 2021的文章

MSSQL new line in XML cannot using char(13)

圖片
  Problem  Cannot use char(13) Solved Becuase of XML select replace(PositionName, ',', char(13)) from ( Select( SUBSTRING( ( SELECT ',' + PositionName  AS [text()] from RecruitmentPosition left join Position on Position.PositionId = RecruitmentPosition.PositionId and  (Position.InactiveTime is null or Position.InactiveTime >= getDate())   where RecruitmentPosition.RecruitmentId = RecruitmentApplicant.RecruitmentId and  (RecruitmentPosition.InactiveTime is null or RecruitmentPosition.InactiveTime >= getDate())  ORDER BY PositionName FOR XML PATH ('') ), 2, 1000) ) as PositionName  ) as t1

concat row to one column mssql

圖片
  select p_name, p_cname + p_cgname as p_cname, p_hkid , p_hphone2, PersonalEmail,PositionName, PositionCode, ConfigService.Code + '  ' + ConfigDepartment.Code as ServiceDepartmentCode, RecruitmentApplicant.RecruitmentId from RecruitmentApplicant left join RecruitmentPosition on RecruitmentPosition.RecruitmentId = RecruitmentApplicant.RecruitmentId and  (RecruitmentPosition.InactiveTime is null or RecruitmentPosition.InactiveTime >= getDate())  left join Position on Position.PositionId = RecruitmentPosition.PositionId and  (Position.InactiveTime is null or Position.InactiveTime >= getDate())   left join ConfigDepartment on ConfigDepartment.DepartmentId = Position.DepartmentId  and  (ConfigDepartment.InactiveTime is null or ConfigDepartment.InactiveTime >= getDate())   left join ConfigService on ConfigService.serviceId = Position.serviceId  and  (ConfigService.InactiveTime is null or ConfigService.InactiveTime ...

Google Sheets and .NET Core with C# Log

圖片
  https://developers.google.com/sheets/api/quickstart/dotnet#prerequisites https://developers.google.com/sheets/api/quickstart/dotnet using GetGooglForm.Models; using Google.Apis.Auth.OAuth2; using Google.Apis.Services; using Google.Apis.Sheets.v4; using Google.Apis.Sheets.v4.Data; using Google.Apis.Util.Store; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace GetGooglForm.Controllers {     public class HomeController : Controller     {         private readonly ILogger<HomeController> _logger;         public HomeController(ILogger<HomeController> logger)         {             _logger = logger;         }         static string[] Scopes ...