Hi All,
It is long time (almost 1 year :) ) blogging. I was little lazy and I am thinking I should start blogging again from now without long gaps. To continue with I am going to give updates about myself in this. I have joined Cognizant on Apr 12 2010 after working in MPhasis, an HP company. I never feel like working there after having worked in AIG Systems Solutions a wonderful company wih cool environment and people with good attitude for almost four and a half years.
It was hard time before assigned to a project in Cognizant. 3 weeks simply passed without any work :). After having attended 4 interviews, atlast I was selected for the FORD project in Cognizant. Actually I was very much hesitant to that project since I have to work in second shift from 12:30 to 8:30. But now I feel I became quite comfortable with the timings, work culture and environment. Enjoying working here. That is it for now. Catch you guys in the next blog with more updates and interesting things.
Friday, May 14, 2010
Wednesday, June 17, 2009
How to disable the Close button of win forms?
Many times, there was a requirement to hide or disable the close button at the top right of the form.
The below code disables the close button without hiding the window's icon.
There is a way to hide the control box by setting the ControlBox property to false. But unfortunately it removes the Windows icon which could be key to the company's/personal branding/marketing efforts.
The below code disables the close button without hiding the window's icon.
IndexOf method in strings
The string's IndexOf methods are all case-sensitive.
Fortunately, we have the CompareInfo class in the Globalization namespace, that includes a case-insensitive IndexOf method
using System.Globalization;
string strValue = "C# is a GREAT programming language.";
string strCheck = "great";
CompareInfo Compare = CultureInfo.InvariantCulture.CompareInfo;
int i = Compare.IndexOf( strValue, strCheck, CompareOptions.IgnoreCase );
Compare.IndexOf here returns the index of the string "great".
Fortunately, we have the CompareInfo class in the Globalization namespace, that includes a case-insensitive IndexOf method
using System.Globalization;
string strValue = "C# is a GREAT programming language.";
string strCheck = "great";
CompareInfo Compare = CultureInfo.InvariantCulture.CompareInfo;
int i = Compare.IndexOf( strValue, strCheck, CompareOptions.IgnoreCase );
Compare.IndexOf here returns the index of the string "great".
Monday, June 1, 2009
Get Row Count of the table
Normally count(*) will be used to query the no of records of a table. But this might consume significant resources if the tables are very big because scanning a large table or index can consume a lot of I/O.
One way to find the number of rows is through sysindexes. The value of sysindexes.indid will always be 0 for a table and 1 for a clustered index. If a table doesn't have a clustered index, its entry in sysindexes will always have an indid value of 0. If a table does have a clustered index, its entry in sysindexes will always have an indid value of 1.
SELECT object_name(id) ,rowcnt FROM sysindexes WHERE indid IN (1,0) AND OBJECTPROPERTY(id, 'IsUserTable') = 1 and object_name(id) = ''
One way to find the number of rows is through sysindexes. The value of sysindexes.indid will always be 0 for a table and 1 for a clustered index. If a table doesn't have a clustered index, its entry in sysindexes will always have an indid value of 0. If a table does have a clustered index, its entry in sysindexes will always have an indid value of 1.
SELECT object_name(id) ,rowcnt FROM sysindexes WHERE indid IN (1,0) AND OBJECTPROPERTY(id, 'IsUserTable') = 1 and object_name(id) = '
Subscribe to:
Comments (Atom)