Posts

Solution of This Error : Error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

Add This section to your Test Project csproj <Target Name="CopyDepsFiles" AfterTargets="Build" Condition="'$(TargetFramework)'!=''">     <ItemGroup>       <DepsFilePaths Include="$([System.IO.Path]::ChangeExtension('%(_ResolvedProjectReferencePaths.FullPath)', '.deps.json'))" />     </ItemGroup>        <Copy SourceFiles="%(DepsFilePaths.FullPath)" DestinationFolder="$(OutputPath)" Condition="Exists('%(DepsFilePaths.FullPath)')" />   </Target>

Check Palindrome Number from a string

 static void Main(string[] args)         {                         Console.WriteLine(" Enter string");             string s = Console.ReadLine();             Console.WriteLine(PalindromNo(s));             Console.ReadLine();         }  public static string PalindromNo(string str)         {             string strOut = string.Empty;             string revs = string.Empty;             if (!string.IsNullOrEmpty(str))             {                 for (int i = str.Length-1; i >= 0; i--)                 {                     revs += str[i].ToString();                 }                 if (revs == str)                 {                     strOut = "YES";                 }                 else                     strOut = "No";             }             else                 strOut = "Enter a string to check palindrom";             return strOut;         }

Make a uppercase string character to lowercase and vice-versa

Its a program to change a uppercase letter to lowercase and  the lower case letter to uppercase. The input is a string.         static void Main(string[] args)         {            Console.WriteLine(CheckNo("abcdEF"));            Console.ReadLine();         }  public static string CheckNo(string s)         {             StringBuilder sb = new StringBuilder();             Char ch ;             char[] arr1;             char[] c = s.ToCharArray();             for (int i = 0; i < c.Length; i++)             {                 if (Char.IsUpper(c[i]))                 {                     ch = Char.ToLower(c[i]);                 }                 else                     ch = Char.ToUpper(c[i]);                 sb.Append(ch.ToString());             }             return sb.ToString();         }

Insert Comma Separated String to Database table in My SQL

 If the database table contains this id than it update the data if not contain it insert a new record which are not in table  I am writing this for my requirement ,you can also change the input parameter as per your requirement. DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `USP_Update_ServiceTask`(             in  in_Action           varchar(10),         in  PKService_Task_ID   int,         in  in_serviceid        int,         in  in_TaskIds          varchar(8000),         in  in_Updatedby        varchar(50),         out  message            varchar(50) ) BEGIN     DECLARE vDone tinyint(1) DEFAULT 1;     DECLARE vIndex INT DEFAULT 1;     DECLARE vSubString VARCHAR(15);     DECLARE  vSeparator VARCHAR(5);     DECLARE  count      INT;        if in_Action='U' then                    SET vSeparator = ',';             WHILE vDone > 0                 DO                   SET vSubString = SUBSTRING(in_TaskIds, vIndex,                                     IF

Split Comma Separated String in My SQL

DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `String_Split`(  vString VARCHAR(8000),   vSeparator VARCHAR(5) ) BEGIN DECLARE vDone tinyint(1) DEFAULT 1; DECLARE vIndex INT DEFAULT 1; DECLARE vSubString VARCHAR(15); DROP TABLE IF EXISTS tmpIDList; CREATE TEMPORARY TABLE tmpIDList (ID INT); WHILE vDone > 0 DO   SET vSubString = SUBSTRING(vString, vIndex,                     IF(LOCATE(vSeparator, vString, vIndex) > 0,                       LOCATE(vSeparator, vString, vIndex) - vIndex,                       LENGTH(vString)                     ));                                          IF LENGTH(vSubString) > 0 THEN       SET vIndex = vIndex + LENGTH(vSubString) + 1;       INSERT INTO tmpIDList VALUES (vSubString);   ELSE       SET vDone = 0;   END IF;     END WHILE;   END you can call this for every string passed by fronend and use this any sql query ,After that you should drop the temp table     like :  call  String_Split('1,

How to creat slideshow in javascript

Slidesh Step 1: Open your webpage and paste the following code anywhere between <body> and </body>: <!----------------------------------------------> <!-- START OF CODE FOR THE SLIDESHOW --> <!----------------------------------------------> <!-- CONFIGURATION OF TEXT-STYLE STARTS HERE --> <style> .textstyle {                 /* style attributes for the comments */                 font-family:Arial;                 font-size:8pt;                 color:#aaaaaa;                 background-color:#FFFFFF;                 text-align:center;                 vertical-align:middle; } .boxstyle{                 /* style attributes for the slideshow-box */                 overflow:hidden;                 border-style:solid;                 border-width:1px;                 border-color:white;                 /* shadow for Firefox */                 -moz-box-shadow: 5px 5px 8px #AAAAAA;      
Ajaya