> 1.Count_big always returns the Bingint values…but count returns theint values 2.Both count the No of Rows in a table Water for Elephants21
Archive for February, 2009
>Difference b/w COUNT_BIG and COUNT in SQL server
Posted in SQL Server on February 14, 2009 | Leave a Comment »
>To Create Custom exception in C#.Net
Posted in Uncategorized on February 14, 2009 | Leave a Comment »
>#region Custom Exception Classes class ExTask : Exception { public ExTask() { } public ExTask(string message) : base(message) { } } #endregion ==================================================================To catch the custom Exception : catch (ExTask ex) { // Do to Log Handler } ================================================================== For the above example “ExTask” is the custom exception name. 1.your Exception wants to inherit the [...]
>To Execute the Remote Machine Process Example To reset the iis of remote machine
Posted in Uncategorized on February 14, 2009 | Leave a Comment »
> ProcessStartInfo psi = new ProcessStartInfo(“iisreset.exe”, “RematoreMachineName -stop”); psi.UserName = “RemoteMachineUserName”; psi.Domain = “DomainNameOfRemoteMachine”; psi.UseShellExecute = false; string password = “RemoteMachinePassword”; System.Security.SecureString o = new System.Security.SecureString(); foreach (char c in password) { o.AppendChar(c); } psi.Password = o; Process.Start(psi);
>Information about W3wp.exe File
Posted in Uncategorized on February 14, 2009 | Leave a Comment »
>Description: File w3wp.exe is located in a subfolder of C:\Windows\System32 or sometimes in a subfolder of “C:\Program Files”. Known file sizes on Windows XP are 7168 bytes (66% of all occurrence), 6656 bytes.w3wp.exe is a Windows system file. The program has no visible window. w3wp.exe is a trustworthy file from Microsoft. Program listens for or [...]
>Use double quotes on string in .NET
Posted in Uncategorized on February 14, 2009 | Leave a Comment »
>We can use double quotes on the string.Example : Declaration:__________string a=”double quotes Example”; string b= “\””+a+”\””; The out put is like this:_________________a= double quotes Example; b= ” double quotes Example”;
>Region based default button in ASP.NET
Posted in Uncategorized on February 10, 2009 | Leave a Comment »
>Another one Simple Method is use the Panel inside it put the Default Button Focus To It<!– –!> You can also kept the focus coding at the Form tag itself If we want to provide the enter key focus based on the particular region we can use panel (or) form tag with “defaultbutton” properties. Inside [...]
>Getting the group of files from directory with the name specific
Posted in Uncategorized on February 10, 2009 | Leave a Comment »
>DirectoryInfo di = new DirectoryInfo(“c:\\accounts”); FileInfo[] fArr = di.GetFiles(“??A??.txt”); for (int iCounter = 0 ; iCounter iCounter++) { string str = fArr[iCounter].Name; } For the above Example i am loading the group of files from the directory of “C:\\\accounts” with the file third letter of “A” di.GetFiles(“A??.txt”); For the above Example i am loading the [...]
>Random string generation in C#.Net
Posted in Uncategorized on February 10, 2009 | Leave a Comment »
>private string RandomString(int size, bool lowerCase){StringBuilder builder = new StringBuilder();Random random = new Random();char ch ;for(int i=0; i{ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;builder.Append(ch);}if(lowerCase)return builder.ToString().ToLower();return builder.ToString();}
>Dynamically load user control in ASP.NET Webform
Posted in Uncategorized on February 10, 2009 | Leave a Comment »
>User Controls are semi-autonomous pages of HTML and underlying ASP.NET code that can be inserted into ASP.NET pages. As such they are useful for adding blocks of functionality to pages. Typical uses are to use User Controls for page headers and footers. They can also add functionality such as a “property of the week” for [...]
>Creating a Cookie in ASP.NET
Posted in Uncategorized on February 10, 2009 | Leave a Comment »
>#region Creating Cookies HttpCookie JayaCookie = Request.Cookies["CookieExample"]; if (HttpContext.Current.Request.Cookies["CookieExample"].Value == null) { HttpContext.Current.Response.Cookies["CookieExample"].Value = Session.SessionID; HttpContext.Current.Response.Cookies["CookieExample"].Expires = DateTime.Now.AddYears(30); } #endregion For the above Example the cookie name is “CookieExample”.I assigned the SessionID value to the cookie