MVC pattern in AngulaJS
//defining module
var app=angular.module(“app”,[]);
//defining controller
app.controller(‘Ctrl’, function ($scope)
{
//defining book’s authors model
var bookAuthors=[“Leardershiop”,”Human”]
//defining book viewmodel
$scope.books = { id: ‘ABXY01’, name: ‘Welcome to this blog’,
authors: bookAuthors}
});
| Book Id : | |
| Name : | |
| Authors : |
DECLARE @String AS VARCHAR(100)DECLARE @strSearch AS VARCHAR(100)SET @String ='Hi SQL SERVER is from Microsoft'SET @strSearch ='Hi'--Find First occurrence of any character or word in the stringSELECT CHARINDEX(@strSearch ,@String) As [Result]--OUTPUT |
___________________
1
- Find Last occurrence of any character or word in the string :
DECLARE @String AS VARCHAR(100)DECLARE @strSearch AS VARCHAR(100)SET @String ='The SQL SERVER is from Microsoft hi'SET @strSearch ='hi'--Find Last occurrence of any character or word in the stringSELECT DATALENGTH(@String)-CHARINDEX(REVERSE(@strSearch ),REVERSE(@String))-1 As [Result] |
_________________________
33
How to find number of occurrence of char or word in a string ?
SQL Query
To get number of occurrence of a char in string
Number of times char ‘l’ is repeated 3 times
Output : 3
SQL Query to get number of occurrence of a word in string
Number of times word ‘you’ is repeated 1 time
Output : 1
How to read System Date dynamically from windows registry file in C# ?
Get System Date and Time from windows registry
public static string GetSystemDateFormat()
{
RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@”Control Panel\International”, true);
if (rkey != null)
{
return rkey.GetValue(“sShortDate”).ToString();
}
else
{
return CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
}
}
C# sample Code to get date and time
public static string GetSystemDateTimeFormat()
{
RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@”Control Panel\International”, true);
if (rkey != null)
{
return rkey.GetValue(“sShortDate”).ToString() + rkey.GetValue(“sTimeFormat”).ToString();
}
else
{
return CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
}
}
How to get comma separated words with single quote in C#?
LINQ Get comma separated words with single quote in C#
- First parameter itemCollection is input | Hello+we+are+here
- Second parameter separator is char | ‘+‘
How to backup mysql database from command line?
Easy way to back up MySQL database from command line
Steps by Step
-
Open command prompt window; Windows + R ; type cmd
- Copy the below line fully
- mysqldump -u root -p -h localhost yourdbname >dbbackfilename.sql
- Right click on command window and paste it; press enter key
- It will ask for password; press enter key again and wait for a second
- Your backup file is generated under C:\Windows\System32\subs_mBackup.sql folder






