only My site

Saturday, August 30, 2008

Wednesday, July 30, 2008

c# String functions Part1

// Create a Unicode String with 5 Greek Alpha characters
String szGreekAlpha = new String('\u0319',5);
// Create a Unicode String with a Greek Omega character
String szGreekOmega = new String(new char [] {'\u03A9','\u03A9','\u03A9'},2,1);

String szGreekLetters = String.Concat(szGreekOmega, szGreekAlpha, szGreekOmega.Clone());

// Examine the result
Console.WriteLine(szGreekLetters);

// The first index of Alpha
int ialpha = szGreekLetters.IndexOf('\u0319');
// The last index of Omega
int iomega = szGreekLetters.LastIndexOf('\u03A9');

Console.WriteLine("The Greek letter Alpha first appears at index " + ialpha +
" and Omega last appears at index " + iomega + " in this String.");

Window - open, move

Window.open method opnes a window and window.move method Moves the screen position of the upper-left corner of the window to the specified iX and iY position.


mywindow=window.open('BalaSanHome.aspx','whatever','toolbar=no,status=no,width=500,height=250,scrollbars=no,directories=no,location=no,resizable=no,menubar=no,screenX=400,screenY=300,top=290,left=600' ,true);
mywindow.moveTo(300,300);

Correlated Sub query - Sample

SELECT Id, Status_Date,Status_Description FROM T1612_INV_STATUS [ST]
WHERE Status_Date = ( SELECT Max(Status_Date) FROM T1612_INV_STATUS WHERE [ST].Id = Track_Id)

Master Page - Tips

When using masterPage system, i can't access the "ScriptManager1" object within the codebehind of ContentPage file..
You access the scriptManager from a content page using the static GetCurrent method:

ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);

Also we can use Type casting..

if (((MasterPage)Master).FindControl("ScriptManager1") != null)
{
ScriptManager scm;
scm = (ScriptManager)((MasterPage)Master).FindControl("ScriptManager1");
scm.SetFocus(txtHdrDet_CMNumber);
}

Tuesday, July 29, 2008

Los Angeles earthquake

I felt the shake and we came out from the office.

The USGS says a magnitude-5.4 earthquake has struck the L.A, area. Stay with CNN.com Live for continuing coverage.


A moderate, magnitude 5.4 earthquake struck just east of Los Angeles, the U.S. Geological Survey says. The epicenter was about 2 miles southwest of Chino Hills. No injuries or serious damge were reported. But residents were warned to check homes for gas leaks and to be on alert for more aftershocks. "Everything was moving," said iReporter Danny Casler.

Monday, July 28, 2008