10 August 2014

Could not find any resources appropriate for the specified culture or the neutral culture

In properties go to Application Tab. Here in applicatin tab verify your assembly name and Default namespace.
You need to change them appropriately in order to eliminate this error.

09 August 2014

Add character in the ascii sequence

Today, we will take a One Scenario for  add character in the ascii sequence to a given string immediately after every character.
Eg:
   Input :LAKSHMI
  Output:LM AB KL ST HI MN IJ.
Here is a Code:
#region Declaration
private string _addValue = string.Empty;
private string _result = string.Empty;
private string _res = string.Empty;
#endregion
 #region Functions
private string AddValues(string c)
{
switch (c)
{
case "A": _addValue = "AB";
break;
 case "B": _addValue = "BC";
 break;
case "C":
 _addValue = "CD";
break;
case "D":
_addValue = "DE";
break;
case "E":
 _addValue = "EF";
break;
case "F":
_addValue = "FG";
break;
case "G":
 _addValue = "GH";
break;
case "H":
 _addValue = "HI";
break;
case "I":
 _addValue = "IJ";
 break;
case "J":
_addValue = "JK";
 break;
case "K":
_addValue = "KL";
break;
case "L":
 _addValue = "LM";
break;
case "M":
_addValue = "MN";
break;
case "N":
_addValue = "NO";
break;
case "O":
_addValue = "OP";
 break;
case "P":
 _addValue = "QR";
break;
case "R":
_addValue = "RS";
break;
case "S":
_addValue = "ST";
 break;
case "T":
 _addValue = "TU";
break;
 case "U":
 _addValue = "UV";
 break;
 case "V":
 _addValue = "VW";
break;
case "W":
 _addValue = "WX";
break;
case "X":
_addValue = "XY";
break;
case "Y":
_addValue = "YZ";
break;
case "Z":
_addValue = "ZA";
 break;
 }
return _addValue;
}
private string FinalResult(TextBox txt)
{
String str = Convert.ToString(txt.Text);
 char[] szArr = str.ToCharArray();
 for (int idx = 0; idx < szArr.Length; idx++)
{
_result = AddValues(Convert.ToString(szArr[idx]));
if (_res == string.Empty)
{
_res = _result;
}
else
{
_res = _res + " " + _result;
 }
 }
 return _res;
}
 #endregion
Call this function in Button Click Event
private void button1_Click(object sender, EventArgs e)
{
textBox2.Text = FinalResult(textBox1);
}
Conclusion:
   Thanks for your read this article.

06 August 2014

Find All Monday in Current and Previous Year

Find All Monday in Current and Previous Year
SELECT Mondays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num) FROM (SELECT TOP 732 num = ROW_NUMBER() OVER(ORDER BY a.NAME)-366 FROM dbo.syscolumns a, dbo.syscolumns b) n WHERE DATENAME(weekday, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)) = 'Monday'

Find All Monday in Current Year

Find All Monday in Current Year
SELECT Mondays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num) FROM (SELECT TOP 366 num = ROW_NUMBER() OVER(ORDER BY a.NAME)-1 FROM dbo.syscolumns a, dbo.syscolumns b) n WHERE DATENAME(weekday, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)) = 'Monday'

05 August 2014

Find All Fridays in Current AND Next Year

Find All Fridays in Current AND Next Year

SELECT Fridays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num) FROM (SELECT TOP 732 num = ROW_NUMBER() OVER(ORDER BY a.NAME)-1 FROM dbo.syscolumns a, dbo.syscolumns b) n WHERE DATENAME(weekday, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)) = 'Friday'

04 August 2014

Find All Fridays in Current Year

Find All Fridays in Current Year


SELECT Fridays = DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num) FROM (SELECT TOP 366 num = ROW_NUMBER() OVER(ORDER BY a.NAME)-1 FROM dbo.syscolumns a, dbo.syscolumns b) n WHERE DATENAME(weekday, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), n.num)) = 'Friday'

03 August 2014

Get Only Time from datetime 2008

get Only Time from datetime 2008
CONVERT(time,GETDATE(),108) AS HourMinuteSecond

02 August 2014

Get Only Date from datetime in SQL Server 2008

get Only Date from datetime in SQL Server 2008
CONVERT(Date,GETDATE(),101) AS DateOnly

01 August 2014

Why OnAfterInstall not trigger

Please check "Primary Output from (Active)" in Your Application "Custom Action" Install Folder.

Get Only Time from datetime 2005

get Only Time from datetime 2005
CONVERT(VARCHAR(8),GETDATE(),108) AS HourMinuteSecond