This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT RIGHT('000000' + '8896', 6) AS str_new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Listbox items unchecked from another event | |
if (lstBoxOrderNo1.CheckedItems.Count > 0) | |
{ | |
int count = lstBoxOrderNo1.CheckedItems.Count; | |
for (int i = 0; i < count; i++) | |
{ | |
lstBoxOrderNo1.SetItemChecked(lstBoxOrderNo1.CheckedIndices[0], false); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///Prevent users from submitting a form by hitting Enter or | |
//Avoid Enter Key Form Submit in Pop Up | |
$("#txtSubEmpId").on('keypress', function (event) { | |
if (event.which == 13 && self.GetSubEmpbyIDCode() != "") { | |
event.preventDefault(); | |
// Write ur code here; | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- failed to register url http://localhost 9567(any port no) . Same port is using by another project. | |
Right click on project. select Unload project | |
Again Right click and select Edit ProjectName.csproj & remove these 3 lines --> | |
<DevelopmentServerPort>0</DevelopmentServerPort> | |
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |
<IISUrl>http://localhost:62940/</IISUrl> | |
<!--Save and reload the project and you are good to go --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- MD5Hash in SQL | |
DECLARE @password varchar(10)='12345789' | |
SELECT CONVERT(VARCHAR(32), HashBytes('MD5', @password), 2) as MD5Hash | |
--- Data Migration from plain text to MD5Hash | |
INSERT INTO [dbo].[E_SS_User_T] | |
([UserName] ,[UserPassword] ,[UserTypeCode] ,[UserEmployeeID] ,[UserEmpName] ,[UserEmpDesignation] ,[UserIsActive] ,[UserNote] ,[UserCreator] ,[UserCreationDate] ) | |
SELECT usr.[name] , CONVERT(VARCHAR(32), HashBytes('MD5', [password]), 2) as MD5Hash,2 ,emp.AutoId,emp.name, desig.name, usr.isActive,'Migrate From DCTL_STORE' , 31725 ,GETDATE() | |
FROM [DCTL_STORE].[dbo].[user_t] usr inner join |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// Create directory on specific folder | |
string folderPath = "C:\\Excel\\"; | |
if (!Directory.Exists(folderPath)) | |
{ | |
Directory.CreateDirectory(folderPath); | |
} | |
//// Get path of user "Documents" Folder | |
string user = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shipdateFrom = dtpShipFromdate.Value.ToString("yyyy/MM/dd"); | |
shipdateTo = dtpShipTodate.Value.ToString("dd/MM/yyyy"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you dont take any backup before ENCRYPTION, then you need to use third-party tools for decrypting it. | |
For SQL Decryptor tool : Download dbForge SQL Decryptor (sqldecryptor.exe) | |
> Install dbForge SQL Decryptor (with default settings) | |
> Login to the server through server name, user name & password | |
> Go to the required SP. right on SP & select "Show DDL Script" | |
Wait for few second.... SP body will be shown in a window | |
*** If you need to decrypt a number of stored-procedures or any other encrypted objects, I recommend using the Decryption Wizard. To do this, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- This SP is written for weekly backup on Friday. So A scheduler should be created for this SP which will run in every friday & will take full backup. | |
Alter PROCEDURE HRMS_TBD_FullDB_Backup_SP | |
---- WITH ENCRYPTION | |
AS | |
BEGIN | |
DECLARE @MyFileName varchar(1000), @date varchar(100), @location varchar(200), @database varchar(100) | |
set @location = 'E:\DMS\' --set location |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var distinctPOValues = excelDataTable.AsEnumerable().Select(row => new | |
{ | |
DistinctPO = row.Field<string>("PO Code"), | |
DistinctOrderNo = row.Field<string>("Order NO") | |
}).Distinct().ToList(); | |
// Distinct with where condition | |
for (int i = 0; i < distinctPOValues.Count; i++) | |
{ | |
var DistinctOrder = excelDataTable.AsEnumerable().Where(r => r.Field<string>("Buyer PO") == distinctPOValues[i].DistinctPO.ToString() |