Search This Blog

Wednesday, July 18, 2012

nvarchar data type SQL Server

SQL Server > Data Types > nvarchar


  • variable length 
  • Unicode string data.
  • length can be a value from 1 through 4,000.
  • maximum storage size is 2 GB
Example


CREATE TABLE dbo.Person
(
   Name nvarchar(100)
);








Monday, July 16, 2012

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

ASP.NET > Errors

This error normally occurs when we use Response.Redirect or Server.Transfer or Response.End in your code before completing the actual process the page was doing.

In this case what you have to do is

In place of Response.End you have to use HttpContext.Current.ApplicationInstance.CompleteRequest

in place of Response.Redirect, use the Response.Redirect ("home.aspx", false)
in place of Server.Transfer, use the Server.Execute method





Monday, July 9, 2012

DATEADD SQL Server Example

SQL Server > Built-in Functions > DATEADD

Add a number to a specified datepart of that date.

DATEADD (datepart , number , date )

datepart: is the part of date to which an integer number is added.

Example:

SELECT DATEADD(month,1, GetDate()) -- add 1 month to current day
SELECT DATEADD(day,1, GetDate()) -- add 1 month to current day
SELECT DATEADD(year,1, GetDate()) -- -- add 1 year to current day


Find last day of previous month








Monday, June 25, 2012

ref c#

C# Keywords > ref

The ref method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method. Any changes made to the parameter in the method will be reflected in that variable when control passes back to the calling method.


using System;
public class MyClass
{
   public static void Ref(ref char x)
   {
      // The value of i will be changed in the calling method
      x = 'a';
   }
   public static void NoRef(char x)
   {
      // The value of i will be unchanged in the calling method
     x = 'b';
   }
   public static void Main()
   {
      char i = '';    // variable must be initialized
      Ref(ref i);  // the arg must be passed as ref
      Console.WriteLine(i);
      NoRef(i);
      Console.WriteLine(i);
   }
}





How to use the Desktop Alerts feature in Outlook


To open the settings dialog box for the Desktop Alerts feature, follow these steps:
  1. On the Tools menu, click Options.
  2. On the Preferences tab, click E-mail Options.
  3. Click Advanced E-Mail Options.
  4. Click Desktop Alert Settings.
In the Desktop Alert Settings dialog box, you can configure the duration and the transparency of your Desktop Alert notifications for when a new e-mail message is received. To turn off the Desktop Alerts feature, click to clear the Display a New Mail Desktop Alert check box.

Note You only receive Desktop Alert notifications if you have Microsoft Exchange server and Post Office Protocol version 3 (POP3) profiles. Internet Mail Access Protocol version 4 (IMAP4) and HTTP accounts do not support the Desktop Alerts feature.









Thursday, June 21, 2012

?? Operator (C# Reference)

C# > Operators > ?? Operator

The ?? operator,also called the null-coalescing operator, returns the left-hand operand if it is not null, or else it returns the right operand.

Example

// y = x, unless x is null, in which case y = 0.
int y = x ?? 0;










Wednesday, June 20, 2012

Parental Controls on Internet Explorer

Parental Controls on Internet Explorer

1. Go to Internet Explorer on your computer. Click on 'Tools' from the toolbar in the upper right-hand corner of the Web browser. Click on 'Internet Options'

2. Select the 'Content' tab.

3. Find the 'Content Advisor' heading and click on the button labeled 'Enable.'

4. Choose a category from the list. This list will present you with a variety of content categories that you may not want your children to see, such as sites depicting drug or alcohol use, violent images, nudity or bad language.

5. Click on the category you want to control. Then use your mouse to move the slider below the list to set the degree of restriction you want on that type of site. the degree of restriction can range from no restriction at all to the complete blocking of those sorts of sites.

6. Click 'OK.'

7. Set a password. You will be prompted to do so at this point. Setting a password will ensure that no one but you is able to adjust the parental control settings.