SQL Generate Week Number

SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ————————————————————————————————————————————————————————————————————————————————————— ALTER PROC [dbo].[sp_GenerateWeek] AS BEGIN Declare @MyWeekNameOfThisYear int Declare @PreviousLineYear varchar(20) Declare @PreviousLineEnglishDayNameOfWeek varchar(20) Declare @StartAtEnglishDayNameOfWeek varchar(20) —> Set @MyWeekNameOfThisYear = 0 Set @PreviousLineYear = 0 –Set @StartAtEnglishDayNameOfWeek = ‘Monday’ –Set @StartAtEnglishDayNameOfWeek = Read More

VB Read ini file

Private Sub ReadIniFile() Dim myDataLine As String() Dim strConfig As String Dim strSetting As String Dim strSysConfigPath As String = Application.StartupPath & “\Setting.ini” Dim i As Integer Dim mySavePath As String Dim myAppPath As String If IO.File.Exists(strSysConfigPath) Then myDataLine = IO.File.ReadAllLines(strSysConfigPath) For Read More

C# DrawString to Graphics

private void buttonDrawText_Click(object sender, EventArgs e) { // Create string to draw. String drawString = “My Drawing Text”; // Create font and brush. Font drawFont = new Font(“Arial”, 16); SolidBrush drawBrush = new SolidBrush(Color.Blue); // Create point for upper-left corner of drawing. Read More

SQL Dynamic string query

DECLARE @myProvinceCode nvarchar(10) DECLARE @sql nvarchar(4000) SET @sql = ‘SELECT [GeographyKey] ,[City] ,[StateProvinceCode] FROM [AdventureWorksDW2014].[dbo].[DimGeography]’ –EXEC (@SQL) Set @myProvinceCode = ‘VIC’ IF(@myProvinceCode IS NOT NULL) SET @sql = @sql + ‘ WHERE StateProvinceCode = @myProvinceCode ‘ EXEC sp_executesql @sql, N’@myProvinceCode nvarchar(10)’, @myProvinceCode Read More