NEWS

Wednesday, July 27, 2011

Making Web Services Accessible from Script

In order for a Web service to be accessed from script, it must be an .asmx Web service whose Web service class is qualified with the ScriptServiceAttribute attribute. Individual methods to be called from script must be qualified with the WebMethodAttribute attribute.


The following example shows these attributes in Web service code.
 


[ScriptService]
public class SimpleWebService : System.Web.Services.WebService
{

[WebMethod]
public string EchoInput(String input)
{
// Method code goes here.
}
}

To enable Web service calls from script, 
you must register the ScriptHandlerFactory HTTP handler in the application's
 Web.config file. The handler processes calls made from script to .asmx 
Web services. 
The following example shows the Web.config element for adding the handler. 
 


 

type="System.Web.Script.Services.ScriptHandlerFactory"
validate="false"/>



For Web service calls that are not issued from ASP.NET AJAX script,
the ScriptHandlerFactory handler delegates the call to the default handler,
which uses SOAP instead of JSON format.
The delegation is performed automatically and you do not have to take any
action unless you want to disable the use of the SOAP protocol for the Web
services. In that case, you must enter the following configuration setting
in the Web.config file.

Using Web Services in ASP.NET AJAX

This topic describes how to access Web services from client script in AJAX-enabled ASP.NET Web pages. The services can be either custom services that you create, or built-in application services. The application services are provided as part of ASP.NET AJAX, and include authentication, roles, and profile services.

Custom Web services can be in the form of .ASP.NET Web services (.asmx services), or Windows Communication Foundation (WCF) services (.svc services).
 
ASP.NET enables you to create Web services that can be accessed from client script in Web pages. The pages communicate with the server through a Web service communication layer that uses AJAX technology to make Web service calls. Data is exchanged asynchronously between client and server, typically in JSON format.
 

Client-Server Communication for AJAX Clients

In AJAX-enabled Web pages, the browser makes an initial request to the server for the page, and then makes subsequent asynchronous requests to Web services for data. The client communication elements are in the form of downloaded proxy classes from the server and the core client-script library. The server communication elements are handlers and custom services. The following illustration shows the elements that are involved in the communication between the client and the server.

AJAX Client Architecture

Browsers call Web service methods by using proxy classes. A proxy class is a script that is automatically generated by the server and downloaded to the browser at page-load time. The proxy class provides a client object that represents the exposed methods of a Web service.

To call a Web service method, client script calls the corresponding methods of the proxy class. The calls are made asynchronously, through the XMLHTTP object.

The Web service communication layer contains the library script types that enable the proxy classes to make service calls. For more information, see the classes that are contained in the Sys.Net namespace.

The code in the proxy classes and in the core Web service communication layer hides the complexity of XMLHTTP and the differences between browsers. This simplifies the client script that is required to call the Web service.

There are two approaches to making a Web service request:

Call Web services by using the HTTP POST verb. A POST request has a body that contains the data that the browser sends to the server. It does not have a size limitation. Therefore, you can use a POST request when the size of the data exceeds the intrinsic size limitation for a GET request. The client serializes the request into JSON format and sends it as POST data to the server. The server deserializes the JSON data into .NET Framework types and makes the actual Web service call. During the response, the server serializes the return values and passes them back to the client, which deserializes them into JavaScript objects for processing.

Call Web services by using the HTTP GET verb. This resembles the functionality of a POST request, with the following differences:

The client uses a query string to send the parameters to the server.

A GET request can call only a Web service method that is configured by using the ScriptMethodAttribute attribute.

Data size is limited to the URL length allowed by the browser.
 
AJAX Client Architecture
 
Elements of the client architecture include the Web service communication layer in the core library and the downloaded proxy classes for the services that are used on the page. Individual elements shown in the figure are as follows:


Custom Service Proxy Classes. These consist of client script that is automatically generated by the server and downloaded to the browser. The proxy classes provide an object for each WCF or ASMX service that is used in the page. (That is, they provide an object for each item in the ServiceReferences element of the ScriptManager control in the page.) Calling a proxy method in client script creates an asynchronous request to the corresponding Web service method on the server.

Authentication Proxy Class. The AuthenticationService proxy class is generated by the server authentication application service. It enables the user to log on or log out through JavaScript in the browser without making a round trip to the server.

Role Proxy Class. The RoleService proxy class is generated by the server roles application service. It enables you to group users and treat each group as a unit through JavaScript without making round trips to the server. This can be useful to enable or deny access to resources on the server.

Profile Proxy Class. The ProfileService class is generated by the server profile application service. It makes the current user's profile information available to the client through JavaScript without making round trips to the server.

Page Methods Proxy Class. This provides the scripting infrastructure for client script to call static methods in an ASP.NET page as if they were Web service methods. For more information, see Calling Web Services from Client Script.

Web Service Communication Layer. This is the library that contains the client script types. These types enable the browser (client) to communicate with the services on the server. They also shield client applications from the complexities of establishing and maintaining the asynchronous communication between client and server. They encapsulate the browser XMLHTTP object that provides the asynchronous capability, and enable client applications to be browser independent. The following are the main elements of the Web service communication layer:

WebRequest . This provides client script functionality to make a Web request. For more information, see the WebRequest class.

WebRequestManager . This manages the flow of the Web requests issued by the WebRequest object to the associated executor object. For more information, see the WebRequestManager class.

XmlHttpExecutor . This makes asynchronous network requests by using the browser's XMLHTTP support. For more information, see the XmlHttpExecutor class.

JSON Serialization. This serializes JavaScript objects into JSON format. Deserialization is available by using the JavaScript eval function. For more information, see the JavaScriptSerializer class.

The default serialization format is JSON, but individual methods in Web services and in ASP.NET Web pages can return alternative formats such as XML. The serialization format of a method can be specified with attributes. For example, for an ASMX service, you can set the ScriptMethodAttribute attribute to cause a Web service method to return XML data, as shown in the following example:
 
[ScriptMethod(ResponseFormat.Xml)]



AJAX Server Architecture

Elements of the server architecture include the Web service communication layer with a HTTP handler and serialization classes, custom services, page methods, and application services. Individual elements shown in the figure are as follows:

Custom Web Services. These provide the service functionality that you implement and return the appropriate response to the client. Custom Web services can be ASP.NET or WCF services. The Web service communication layer automatically generates client-script proxy classes that can be called asynchronously from client script.

Page Methods. This component enables a method in an ASP.NET page to be called as if it were a Web service method. Page methods must be defined in the page that is performing the page-method call.

Authentication Service. The authentication service generates an authentication proxy class that enables the user to log on or log out through client JavaScript. This application service is always available and you do not have to instantiate it. For more information, see Using Forms Authentication with ASP.NET AJAX.

Role Service. The role service generates a role proxy class that enables client JavaScript to access roles information for the currently authenticated user. This application service is always available and you do not have to instantiate it. For more information, see Using Roles Information with ASP.NET AJAX.

Profile Service. The profile service generates a profile proxy class that enables client JavaScript to get and set profile properties for the user that is associated with the current request. This application service is always available and you do not have to instantiate it. For more information, see Using Profile Information with ASP.NET AJAX.

JSON Serialization. The server JSON serialization component enables customizable serialization and deserialization of common .NET Framework types to and from JSON format. For more information, see JavaScriptSerializer.

XML Serialization. The Web service communication layer supports XML serialization for SOAP requests to Web services and for returning XML types from a JSON request to a Web service.


 

Tuesday, July 26, 2011

Implementing Client Callbacks Programmatically Without Postbacks in ASP.NET Web Pages

In the default model for ASP.NET Web pages, the user interacts with a page and clicks a button or performs some other action that results in a postback. The page and its controls are re-created, the page code runs on the server, and a new version of the page is rendered to the browser. However, in some situations, it is useful to run server code from the client without performing a postback. If the client script in the page is maintaining some state information (for example, local variable values), posting the page and getting a new copy of it destroys that state. Additionally, page postbacks introduce processing overhead that can decrease performance and force the user to wait for the page to be processed and re-created.

To avoid losing client state and not incur the processing overhead of a server roundtrip, you can code an ASP.NET Web page so that it can perform client callbacks. In a client callback, a client-script function sends a request to an ASP.NET Web page. The Web page runs a modified version of its normal life cycle. The page is initiated and its controls and other members are created, and then a specially marked method is invoked. The method performs the processing that you have coded and then returns a value to the browser that can be read by another client script function. Throughout this process, the page is live in the browser.

Several Web server controls can use client callbacks. For example, the TreeView control uses client callbacks to implement its populate-on-demand functionality. For more information see TreeView Web Server Control Overview.
 
There are several options for automating client callbacks in an ASP.NET Web page. AJAX features in ASP.NET such as the UpdatePanel server control can automate asynchronous partial-page updates for you, and the Web service communication feature can automate asynchronous Web service calls.
 
For an overview of AJAX features in ASP.NET that automate client callbacks for you, see the following topics:

 
Components of Client Callbacks


Creating an ASP.NET page that programmatically implements client callbacks is similar to creating any ASP.NET page, with a few these differences. The page's server code must perform the following tasks:

Implement the ICallbackEventHandler interface. You can add this interface declaration to any ASP.NET Web page.

Provide an implementation for the RaiseCallbackEvent method. This method will be invoked to perform the callback on the server.

Provide an implementation for the GetCallbackResult method. This method will return the callback result to the client.

In addition, the page must contain three client script functions that perform the following actions:

One function calls a helper method that performs the actual request to the server. In this function, you can perform custom logic to prepare the event arguments first. You can send a string as a parameter to the server-side callback event handler.

Another function receives (is called by) the result from the server code that processed the callback event, accepting a string that represents the results. This is referred to as the client callback function.

A third function is the helper function that performs the actual request to the server. This function is generated automatically by ASP.NET when you generate a reference to this function by using the GetCallbackEventReference method in server code.
Both client callbacks and postbacks are requests for the originating page. Therefore, client callbacks and postbacks are recorded in Web server logs as a page request.
 
Implementing the Required Interfaces in Server Code


You can declare the ICallbackEventHandler interface as part of the class declaration for the page. If you are creating a code-behind page, you can declare the interface by using syntax such as the following.
 
public partial class CallBack_DB_aspx :
System.Web.UI.Page, System.Web.UI.ICallbackEventHandler
 
If you are working in a single-file page or user control, you can add the declaration by using an @ Implements directive in the page, as in the following examples
 
 

Creating a Server Callback Method

In server code, you must create a method that implements the RaiseCallbackEvent method and a method that implements the GetCallbackResult method. The RaiseCallbackEvent method takes a single string argument instead of the usual two arguments that are typically used with event handlers. A portion of the method might look like the following example:

public void RaiseCallbackEvent(String eventArgument)
{


}
 
The GetCallbackResult method takes no arguments and returns a string. A portion of the method might look like the following example:
 
public string GetCallbackResult()
{
return aStringValue;
}
 
Creating Client Script Functions
You must add client script functions to the page to perform two functions: send the callback to the server page, and receive the results. Both client script functions are written in ECMAScript (JavaScript).

Sending the Callback

The function to send the callback is generated in server code. The actual callback is performed by a library function that is available to any page that implements the ICallbackEventHandler interface. You can get a reference to the library function by calling the page's GetCallbackEventReference method, which is accessible through the ClientScript property of the page. You then build a client function dynamically that includes a call to the return value from the GetCallbackEventReference method. You pass to that method a reference to the page (this in C# or Me in Visual Basic), the name of the argument that you will use to pass data, the name of the client script function that will receive the callback data, and an argument that passes any context you want.

When you have built the function, you inject it into the page by calling the RegisterClientScriptBlock method.

The following example shows how to dynamically create a function named CallServer that invokes the callback.
 
void Page_Load(object sender, EventArgs e)
{
       ClientScriptManager cm = Page.ClientScript;
       String cbReference = cm.GetCallbackEventReference(this, "arg",
                                          "ReceiveServerData", "");
       String callbackScript = "function CallServer(arg, context) {" +
                                            cbReference + "; }";
       cm.RegisterClientScriptBlock(this.GetType(),
                                        "CallServer", callbackScript, true);
}
 
The names of the arguments that are accepted by the function you are generating must match the names of the values that you pass to the GetCallbackEventReference method.

The following example shows some markup that could be used to invoke the callback and process its return value:


onclick="CallServer(1, alert('Callback'))"/>


 

Receiving the Callback

You can write the client function that receives callbacks statically in the page. The function must be named to match the name that you pass in the call to the GetCallbackEventReference method. The receiving function accepts two string values: one for the return value and an optional second value for the context value that is passed back from the server.

The function might look like the following example:
 
reference:

Thursday, July 21, 2011

Convert int to string in LINQ to Entities Query

ddEnrollmentMethod.DataSource = from t in context.EnrollmentMethods
orderby t.Name
select new { Name = SqlFunctions.StringConvert((double)t.EnrollmentMethodID) + ". " + t.Name, t.EnrollmentMethodID };


Wednesday, July 20, 2011

Sarbanes-Oxley Act (SOX)

The Sarbanes-Oxley Act of 2002 (often shortened to SOX) is legislation enacted in response to the high-profile Enron and WorldCom financial scandals to protect shareholders and the general public from accounting errors and fraudulent practices in the enterprise. The act is administered by the Securities and Exchange Commission (SEC), which sets deadlines for compliance and publishes rules on requirements. Sarbanes-Oxley is not a set of business practices and does not specify how a business should store records; rather, it defines which records are to be stored and for how long.

The legislation not only affects the financial side of corporations, it also affects the IT departments whose job it is to store a corporation's electronic records. The Sarbanes-Oxley Act states that all business records, including electronic records and electronic messages, must be saved for "not less than five years." The consequences for non-compliance are fines, imprisonment, or both. IT departments are increasingly faced with the challenge of creating and maintaining a corporate records archive in a cost-effective

fashion that satisfies the requirements put forth by the legislation.


FAQ: What is the impact of Sarbanes-Oxley on IT operations?

The following sections of Sarbanes-Oxley contain the three rules that affect the management of electronic records. The first rule deals with destruction, alteration, or falsification of records.

Sec. 802(a) "Whoever knowingly alters, destroys, mutilates, conceals, covers up, falsifies, or makes a false entry in any record, document, or tangible object with the intent to impede, obstruct, or influence the investigation or proper administration of any matter within the jurisdiction of any department or agency of the United States or any case filed under title 11, or in relation to or contemplation of any such matter or case, shall be fined under this title, imprisoned not more than 20 years, or both."

The second rule defines the retention period for records storage. Best practices indicate that corporations securely store all business records using the same guidelines set for public accountants.

Sec. 802(a)(1) "Any accountant who conducts an audit of an issuer of securities to which section 10A(a) of the Securities Exchange Act of 1934 (15 U.S.C 78j-1(a)) applies, shall maintain all audit or review workpapers for a period of 5 years from the end of the fiscal period in which the audit or review was concluded."

This third rule refers to the type of business records that need to be stored, including all business records and communications, including electronic communications.


Sec. 802(a)(2) "The Securities and Exchange Commission shall promulgate, within 180 days, such rules and regulations, as are reasonably necessary, relating to the retention of relevant records such as workpapers, documents that form the basis of an audit or review, memoranda, correspondence, communications, other documents, and records (including electronic records) which are created, sent, or received in connection with an audit or review and contain conclusions, opinions, analyses, or financial data relating to such an audit or review."

 Clause 49 is an Indian adaptation of SOX; requiring CEO- CFO to assume responsibility for Internal controls over financial reporting at their organizations. CEO/CFO is a subset Clause 49 of the listing agreement with Securities Exchange Board of India (SEBI).

Tuesday, July 19, 2011

Sealed classes in .NET …

While tinkering with C#, I was experimenting with declaring methods “virtual.” This effectively tells subclasses “you can override this method with your own implementation.” After some more tinkering, it seems you can also hide methods that are not declared virtual by prefixing them with “new.” But there is a difference:




using System;



public class A {

public void method() {

Console.WriteLine("A.method");

}

public virtual void method2() {

Console.WriteLine("A.method2");

}

}



public class B : A {

new public void method() {

Console.WriteLine("B.method");

}

public override void method2() {

Console.WriteLine("B.method2");

}

}



The compiler will not complain about this situation. Now pretend that we execute this: B b = new B(); b.method(); b.method2();. We get the output we expect:



B.method

B.method2



Now let’s try A b = new B(); b.method(); b.method2();. See the difference? This time we store the B in an A reference.



A.method

B.method2



Java users will be shocked at this behaviour. But B.method overrides A.method, right?



Wrong. It hides A.method. If we had said A b = new B(); (b as B).method(); we would get the output we expect. This behavior comes directly from C++: if a non-virtual method is “overridden” then which method gets called depends on the reference type used to call it!



This serves two purposes:



  1. If a method is not declared virtual, the CLR doesn’t have to waste time looking for overridden methods on child classes; it can jump directly to the method.
  2. The virtual modifier can be thought of as giving permission to override. If you target a non-virtual method you know it will behave the same way, so long as you are using the same reference type when invoking it.



Which brings me to the question of the day. C# (and any .NET language) supports the notion of a “sealed” class — one that cannot be derived from at all. Immutable classes, such as System.String, are sealed to prevent tampering that could aggravate developers or compromise the entire .NET security architecture.



But what if System.String weren’t sealed? Why, nothing! Almost. Methods overloaded from Object (such as ToString) are implicitly virtual — but if they were marked “sealed” in System.String they are effectively “un-virtualed!” Redefining ToString in a subclass would require “new” and would exhibit the same behavior as the example above. For example:



using System;



public class A {

public virtual void Foo() {

Console.WriteLine("A");

}

}



public class B : A {

public sealed override void Foo() {

Console.WriteLine("B");

}

}



public class C : B {

new public void Foo() {

Console.WriteLine("C");

}

}



public class R {

public static void Main() {

C c = new C();

B b = c;

A a = b;



a.Foo();

b.Foo();

c.Foo();

}

}



This outputs the expected:



B

B

C



The benefit of un-sealing these classes is that we could subclass System.String to add our own properties, be able to pass this object around as if it were a string, and not sacrifice the integrity of its immutability. As long as none of System.String’s immutable information is protected or public, we can’t touch it.



Where the system treats it as a string, it is a string. Where we treat it as a subclass, we can extend its behavior how we like.


The concept of "Hiding" in c# is the same as the concept of "Shadowing" in vb.net

Javascript questions and answers

1) What is the output of following JavaScript code?

a) 44
b) 8
c) 4
d) Error output

2) What is the output of following JavaScript code?

a) Chadha
b) C,h,a,d,h,a,S,o,f,t,w,a,r,e,T,e,c,h,n,o,l,o,g,i,e,s
c) Chadha,Software,Technologies
d) Chadha Software Technologies

3) Is it possible to nest functions in JavaScript?
a) True
b) False

4) What is the output of following JavaScript code?

a) get code name of the browser of a visitor
b) set code name of the browser of a visitor
c) None of the above

5) Which of the following is true?
a) If onKeyDown returns false, the key-press event is cancelled.
b) If onKeyPress returns false, the key-down event is cancelled.
c) If onKeyDown returns false, the key-up event is cancelled.
d) If onKeyPress returns false, the key-up event is canceled.

6) Scripting language is
a) High Level Programming language
b) Assembly Level programming language
c) Machine level programming language

7) Which best explains getSelection()?
a) Returns the VALUE of a selected OPTION.
b) Returns document.URL of the window in focus.
c) Returns the value of cursor-selected text
d) Returns the VALUE of a checked radio input.

8) What is the output of following JavaScript code?

a) Good %
b) 1,0,0
c) G,o,o,d,%
d) Error

9) What is the output of following JavaScript code?

a) P
b) E
c) S
d) Error

10) Choose the client-side JavaScript object:
a) Database
b) Cursor
c) Client
d) FileUpLoad

11) Are Java and JavaScript the same?
a) No
b) Yes

12) Syntax for creating a RegExp object:
(A) var txt=new RegExp(pattern,attributes);
(B) var txt=/pattern/attributes;
Which of the above mentioned syntax is correct?
a) (A) only
b) (B) only
c) Both (A) and (B)
d) None of the above

13) What is the output of following JavaScript code?

a) Error
b) 2
c) 1
d) 3

14) What is meant by "this" keyword in JavaScript?
a) It refers current object
b) It referes previous object
c) It is variable which contains value
d) None of the above

15) In JavaScript, Window.prompt() method returns true or false value?
a) False
b) True
c) None of above

16) Math.round(-20.51) = ?
a) 20
b) -21
c) 19
d) None

17) What is the output of following JavaScript code?

a) %,!,{,[,!,!
b) Q,u,a,l,i,t,y,1,0,0
c) Quality 100
d) Error

18) What is the output of following JavaScript code?

a) Error
b) Chadha Software Technologies
c) Web Development
d) Web Development,Application Development,Testing,Chadha Software Technologies

19) Choose the server-side JavaScript object among the following:
a) FileUpLoad
b) Function
c) File
d) Date

20) What does parseFloat(9+10) evaluates to in JavaScript?
a) 19
b) 910
c) None

21) What is the output of following JavaScript code?

a) 258
b) Error
c) 7
d) 78

22) _________ keyword is used to declare variables in JavaScript.
a) Var
b) Dim
c) String

23) In JavaScript, which of the following method is used to evaluate the regular expression?
a) eval(2*(3+5))
b) evaluate(2*(3+5))
c) evalu(2*(3+5))
d) None of the above

24) What is the output of following JavaScript code?

a) 100
b) 1,0,0
c) q,u,a,l,i,t,y,%
d) Error

25) What is the output of following JavaScript code?

a) hello
b) bye
c) Error in string handling
d) None of the above

26) What is the output of following JavaScript code?

a) Error
b) SOFTWARE
c) Software
d) null

27) How do you create a new object in JavaScript?
a) var obj = {};
b) var obj = Object();
c) var obj=new {};
d) None of the above

28) What does isNaN function do in JavaScript?
a) Return true if the argument is not a number.
b) Return false if the argument is not a number.
c) Return true if the argument is a number.
d) None of the above

29) If x=103 & y=9 then x%=y , what is the value of x after executing x%=y?
a) 4
b) 3
c) 2
d) 5

30) Choose the external object among the follwing:
a) Date
b) Option
c) Layer
d) Checkbox

31) Choose the four symbol pairs that represent RegExp properties lastMatch, lastParent, leftContext, and rightContext, respectively:
a) $&, $+, $`, $'
b) $+, $&, $', $`
c) $&, $~, $`, $'
d) $+, $&, $`, $'

32) Which of the following properties hold the values of the pixels of the length of the width and height of the viewer's screen resolution?
a) screen.width and screen.height
b) Resolution.width and Resolution.height
c) screen.pixels.width and screen.pixels.height
d) ViewerScreen.width and ViewerScreen.height

33) What does ParseInt("15",10) evaluates to?
a) 15
b) 10
c) 151
d) 150

34) Which JavaScript feature uses JAR files?
a) Object signing
b) Style sheets
c) Netcaster channels
d) Image rollovers

35) How to assign a function to a variable with the JavaScript Function contructor?
a) var f=Function("x","y","return x+y");
b) var f=Function(x,y){ return x+y;}
c) var f= new Function("x", "y", "return x + y");

36) In JavaScript, Window.alert() is used to allow user to enter something
a) True
b) False
c) None of above

37) What is the output of following JavaScript code?

a) in in In
b) in in in
c) in in null
d) in null null

38) Does JavaScript has any DATE data type?
a) Yes
b) No

39) Math.round(-20.5)=?
a) -21
b) 20
c) -20
d) 21

40) ?_name is it valid javascript identifier?
a) Yes
b) No
41) What is the output of following
 JavaScript code?

a) first
b) undefined
c) First
d) Error

42) Which of these comment lines are used in JavaScript?
(1) // , /* ...... **/
(2) / , /** ......./ , /*
(3) /*......*/ , //
(4) \*......*\ , //
a) Only (4)
b) Only (3)
c) Either (3) or (4)
d) Only (2)

43) What is the output of following JavaScript code?

a) ,%,!,{,[,!,!
b) G,i,v,e,1,0,0
c) Give 100
d) Error

44) Which best describes void?
a) A method
b) A function
c) A statement
d) An operator

45) What is the output of following JavaScript code?

a) 2
b) 12
c) 11
d) 13

46) What is the output of following JavaScript code?

a) first
b) First
c) undefined
d) None of the above

47) What is the output of following JavaScript code?

If you call the function callme(), what will happen?
a) 10
b) Error in calling Function
c) 5
d) None of the above

48) Who invented the JavaScript programming language?
a) Tennis Ritchie
b) James Gosling
c) Brendan Eich

49) Can you write HTML tags inside the JavaScript code as shown below?

a) No
b) Yes
c) Impossible

50) Which feature is supported in MSIE 3.x?
a) split()
b) document.clear()
c) join()
d) charAt()

51) How to speicfy the color of the hypertext links with JavaScript?
a) document.linkColor="#00FF00";
b) document.LColor="#00FF00";
c) document.LinkC="#00FF00";
d) document.hyperTextLink="#00FF00":

52) What will be the output of following JavaScript code?

a) Position:-7
b) Position-1
c) null
d) error

53) ________ method returns the number of milliseconds in a date string.
a) setHours()
b) setMinutes()
c) parse()

54) ________ converts a string to floating point numbers.
a) eval
b) ParseInt
c) ParseFloat
d) None

55) ________ attempts to evaluate a string representing any javascript literals or variables, converting it to a number.
a) eval
b) parseFloat
c) parseInt
d) None

56) Which is not an attribute of the cookie property?
a) path
b) host
c) secure
d) domain

57) How do substring() and substr() differ?
a) One is not a method of the String object.
b) substr() takes three arguments, substring() only two.
c) Only one accepts a desired string length as an argument.
d) Besides the spelling, nothing.

58) Which is not a reserved word?
a) interface
b) short
c) program
d) throws

59) In Javascript, which of the following method is used to find out the character at a position in a string?
a) charAt()
b) CharacterAt()
c) CharPos()
d) characAt()

60) What will be the output of following JavaScript code snippter?

a) PHPKB Kn
b) Kn
c) ow
d) n

61) How do you delete an element from an options array?
a) Set it to false.
b) Set it to null.
c) Set it to undefined.
d) Set it to -1

62) Is JavaScript case sensitive language?
a) Yes
b) No

63) JavaScript RegExp Object has modifier 'i' to __________
a) Perform case-sensitive matching
b) Perform case-insensitive matching
c) Perform both case-sensitive&case-insensitive matching

64) What are the following looping structures are available in JavaScript?
a) for, foreach
b) foreach, whileloop
c) do-while loop, foreach
d) for, while loop

65) Which of these is not a method of the Math object?
a) atan()
b) atan2()
c) eval()
d) acos()

66) What will be the output of following JavaScript code snippter?

a) 9123
b) 91234
c) 80000
d) None of the above

67) In javascript, RegExp Object Method test() is used to search a string and returns _________
a) true or false
b) found value
c) index
d) None of the above

68) What property would you use to redirect a visitor to another page?
a) document.URL
b) window.location.href
c) document.location.href
d) link.href

69) In JavaScript, which of the statements below can be used for string declaration?
1) var cst="PHPKB Knowledge Base Software";
2) var cst=new String("PHPKB Knowledge Base Software");
a) Either (1) or (2)
b) Only (1)
c) Neither (1) nor (2)
d) Only (2)

70) What will be the output of following copde snippet?

a) 15
b) 16
c) 19
d) 17

71) What will be the output of following copde snippet?

a) Eat
b) eat
c) undefined
d) Eat eat

72) What will be the output of following copde snippet?

a) in in In
b) in in in
c) in in null
d) in null null

73) -________ method is used to remove focus from the specified object.
a) blur()
b) focus()
c) None
74) What does parseFloat("FF2") evaluates to?
a) 152
b) FF2
c) NaN
d) None
75) eval((20*4)=?
a) Nan
b) 204
c) 24
d) 80

76) What will be the output of following JavaScript code?

a) null
b) Base
c) BASE
d) Error

77) JavaScript is a ________ typed language.
a) tightly
b) loosely


Answers


(1) a (2) c (3) a (4) a (5) a (6) a (7) c (8) c (9) c (10) d
(11) a (12) c (13) b (14) a (15) a (16) b (17) b (18) b (19) c (20) c
(21) d (22) a (23) a (24) b (25) b (26) d (27) a (28) a (29) a (30) d
(31) a (32) a (33) a (34) a (35) c (36) b (37) a (38) b (39) c (40) b
(41) a (42) b (43) a (44) d (45) b (46) c (47) a (48) c (49) b (50) d
(51) a (52) b (53) c (54) c (55) a (56) b (57) c (58) c (59) a (60) d
(61) b (62) a (63) b (64) d (65) c (66) a (67) a (68) b (69) a (70) b
(71) b (72) c (73) a (74) c (75) d (76) b (77) b

reference: http://www.knowledgebase-script.com/demo/article-1015.html

Call HTTPhandler from jQuery, Pass data and retrieve in JSON format

Let’s go step by step



•First create a HTTP Handler say “MyHandler.ashx” and put your logic there

•As we are using jQuery here. So include the jQuery script in your aspx page

•Now write the script to call your Handler at your aspx page in javascript block or write it in a separate script file and include it in your page.

•OnSucessfull complete of your request receive the data and process it as required.

Now lets see the example:

I have created one Website type application and included the jQuery library in my application. Now first lets see , how to call HTTP handler.

function CallHandler() {



$.ajax({


url: "Handler/MyHandler.ashx",


contentType: "application/json; charset=utf-8",


success: OnComplete,


error: OnFail


});


return false;


}

Here url is the url of your Handler. contentType defines the content of the request. On successful completion of the request the OnComplete method will be called. If there is any error of the request the OnFail will be called. The dummy methods are
 
function OnComplete(result) {



alert('Success');


}


function OnFail(result) {


alert('Request failed');


}

Now what you’ll do if you need to pass some data to your handler.  For this you can add one more parameter data in you call. Here you need to give data in form of Name value parameter as
 
data: { 'Id': '100002','Type': 'Employee'}




// Now the updated method as

function CallHandler() {


$.ajax({


url: "Handler/MyHandler.ashx",


contentType: "application/json; charset=utf-8",


data: { 'Id': '10000', 'Type': 'Employee' },


success: OnComplete,


error: OnFail


});


return false;


}
 
Now you can access the data in handler’s ProcessRequest method as
 
string Id = context.Request["Id"];



string type = context.Request["Type"];

Now, If you want to receive data from Handler at Client side. How will you move ahead.


It’s very easy to return data in JSON format.

Here in my sample example, I have created one Class Employee and returning it from handler after serializing with the help of JavaScriptSerializer. My Class is as.
public class Employee



{


public int Id { get; set; }


public string Name { get; set; }


public int Age { get; set; }


public string Department { get; set; }


}


Now let’s see the handler part. I am sending the Id of employee from Client
 
public class MyHandler : IHttpHandler {







public void ProcessRequest (HttpContext context) {






var employee = GetData(Convert.ToInt32(context.Request["Id"]));






//Do the operation as required






JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();


string serEmployee = javaScriptSerializer.Serialize(employee);


context.Response.ContentType = "text/html";\


context.Response.Write(serEmployee);


}






public bool IsReusable {


get {


return false;


}


}






private Employee GetData(int Id)


{


var employee = new Employee();


employee.Id = Id;


employee.Name = "Brij";


employee.Age = 27;


employee.Department = "Research and Development";






//Write your logic here






return employee;


}


}


Now the CallHandler method will be as
 
function CallHandler() {



$.ajax({


url: "Handler/MyHandler.ashx",


contentType: "application/json; charset=utf-8",


dataType: "json",


data: { 'Id': '10000' },


responseType: "json",


success: OnComplete,


error: OnFail


});


return false;


}






function OnComplete(result) {


alert([result.Id, result.Name, result.Age, result.Department]);


}


function OnFail(result) {


alert('Request Failed');


}

Now you can receive the data and use it as per your requirement at client side. Above here I have just shown as alert popup.




reference: http://brijbhushan.net/2011/05/29/call-httphandler-from-jquery-pass-data-and-retrieve-in-json-format/

Monday, July 18, 2011

Top 20 Windows 7 tips

Use Hidden International Wallpapers and Themes


When you first install Windows 7, it asks for your language, time and currency. Based on your responses, it installs a set of wallpapers and themes. If you choose English (United States) for your time and currency format, for example, the available desktop backgrounds and themes will include a United States section with scenery from locations such as Maine, the Southwest and so on.

Hidden, though, are background scenery and themes from other English-speaking countries -- Australia, Canada, Great Britain and South Africa. Normally, you can't access those backgrounds or themes, but there is a simple way you can install and use them:


1. In the search box in the Start menu, type C:\Windows\Globalization\MCT and press Enter. (Note: If Windows 7 is installed in a drive other than C:, use that letter instead.)

2. Windows Explorer will launch and show you a list of subfolders under C:\Windows\Globalization\MCT: MCT-AU, MCT-CA, MCT-GB, MCT-US, and MCT-ZA. Each subfolder has wallpapers for a specific country: AU for Australia, CA for Canada, GB for Great Britain, US for the United States, and ZA for South Africa.

For any of the countries whose wallpaper and themes you want to use, go into its Theme folder, for example, C:\Windows\Globalization\MCT\MCT-ZA\Theme. Double-click the theme you see there (for example ZA).

3. That will install a shortcut to the theme and wallpapers in the Personalization section of Control Panel.


You can now use them as you would any other theme or background, by right-clicking the desktop, choosing Personalize, and choosing a background or theme. They will be listed in their own section.

Shake Your Desktop Free of Clutter


If you frequently run multiple programs simultaneously, your desktop can get extremely cluttered. This can get annoying if you're working on one program and want to minimize all the other windows -- in previous versions of Windows you had to minimize them individually.

With Windows 7's "shake" feature, though, you can minimize every window except the one in which you're currently working -- in a single step. Click and hold the title bar of the window you want to keep on the desktop; while still holding the title bar, shake it quickly back and forth until all of the other windows minimize to the taskbar. Then let go. To make them return, shake the title bar again.

You can accomplish the same thing by pressing the Window key-Home key combination -- although doing that is not nearly as much fun.

Get a Power Efficiency Report

Have a laptop and want to get more battery life out of it? Windows 7 includes a hidden built-in tool that will examine your laptop's energy use and make recommendations on how to improve it. To use it:

1. Run a command prompt as an administrator. To do this, type cmd in the search box, and when the cmd icon appears, right-click it and choose "Run as administrator."

2. At the command line, type in the following:

powercfg -energy -output \Folder\Energy_Report.html

where \Folder represents the folder where you want the report to be placed.

3. For about a minute, Windows 7 will examine the behavior of your laptop. It will then analyze it and create a report in HTML format in the folder you specified. Double-click the file, and you'll get a report -- follow its recommendations for ways to improve power performance.

Modify UAC

The User Account Control security feature was one of the most reviled additions to Windows Vista, with good reason -- its constant warning messages asking for permission to continue many operations drove users around the bend. UAC has been significantly improved in Windows 7 so that it's not as intrusive as in Vista, but you can still tweak it if you like.






Here's how to turn UAC on or off, and make it less or more intrusive than the default:

1. Go to the Control Panel --> User Accounts and Family Safety.

2. Click User Accounts, then click Change User Account Control settings.

3. From the screen that appears, use the slider to select the level of protection you want. Here are the four levels and what they mean:


Always notify me. Think of this as UAC Classic. It works like Vista's UAC: When you make changes to your system, when software is installed or when a program tries to make a change to your system, an annoying prompt appears.

Default -- Notify me only when programs try to make changes to my computer. This is, obviously, the default; make a change yourself and UAC leaves you alone. When a program makes a change, a prompt appears and your desktop goes dark, just like it does in Vista. Otherwise, UAC sits there silently.

Notify me only when programs try to make changes to my computer (do not dim my desktop). This setting is identical to the default setting, with one difference: It won't dim your desktop so that you only see the UAC prompt asking you to take action. This presents a slightly elevated security risk over the default setting, because theoretically a program could allow a malicious program to interfere with the UAC prompt.

Never notify me when: In this one, UAC is completely turned off. This is, of course, an insecure option and not recommended for most users.
After you make the selection, click OK. Depending on the selection you made, you may need to restart your system for it to take effect.

Start Menu tips


Many people overlook the Start Menu, rarely using it except as a jumping off point to run an application or get to the Control Panel. But there's actually plenty you can do with it.

Search the Internet from the Start Menu

The Start Menu's search box is a convenient way to search through your PC -- but you can also have it do double-duty and perform Internet searches as well. To enable this feature:

1. In the Start Menu search box, type GPEDIT.MSC and press Enter to run the Group Policy Editor.

2. Go to User Configuration --> Administrative Templates --> Start Menu and Taskbar.

3. Double-click "Add Search Internet link to Start Menu," and from the screen that appears, select Enabled. Then click OK and close the Group Policy Editor.

4. From now on, when you type a search term in the Search box on the Start Menu, a "Search the Internet" link will appear. Click the link to launch the search in your default browser with your default search engine.


Customize the Shut Down Button

The default action of the Start Menu's Shut down button is to turn off your PC. If you want to use the button for another action, such as restarting your PC, you click the arrow to the right of the Shut down button and select an action from the drop-down menu.

What if you rarely shut your PC down completely but frequently restart it? You can change the Shut down button's default action to be Restart -- or Switch user, Log off, Lock, Sleep or Hibernate.

To change your default, right-click the Start button and select Properties. On the Start Menu tab, click the "Power button action" drop-down menu and select which action you want to be the default. Then click OK, and OK again.

Add a Videos Link to the Start Menu


The Windows 7 Start Menu includes links to your Pictures and Music folders, but not to your Videos folder. If you watch a lot of videos and want a link to them on your Start Menu, here's what you can do

1. Right-click the Start button and select Properties.


2. On the screen that appears, go to the Start Menu tab and click Customize.

3. In the dialog box that appears, scroll to the bottom, look for the Videos section, select "Display as a link," and click OK and then OK again.

If you'd prefer that Videos display as a menu, with links to files and submenus, instead select "Display as a menu."

Windows Explorer tips


Windows Explorer is the heart and soul of the Windows interface, and overall it works quite well. But you can make it better.

Use check boxes to select multiple files

In order to select multiple files for an operation such as copying, moving or deleting in Windows Explorer, you generally use the keyboard and the mouse, Ctrl-clicking every file you want to select. But if you're mouse-centric, there's a way to select multiple files in Windows 7 using only your mouse, via check boxes. To do it:

1. In Windows Explorer, click Organize, and then select "Folder and search options."

2. Click the View tab.

3. In Advanced Settings, scroll down and check the box next to "Use check boxes to select items." Click OK.

4. From now on, when you hover your mouse over a file in Windows Explorer, a check box will appear next to it; click it to select the file. Once a file is selected, the checked box remains next to it; if you uncheck it, the box will disappear when you move your mouse away.

Open a command prompt at any folder


Command prompt fans will welcome this tip. With it, when you're in Windows Explorer, you can open a command prompt to any folder. This tip does exactly what the Windows XP PowerToy "Open Command Window Here" does.

To use it, hold down the Shift key and right-click a folder, then choose "Open command window here" from the context menu that appears. (Note that this tip doesn't work in the Documents folder.)

Protect the privacy of your Explorer searches
When you search through your PC from Windows Explorer, you can see the most recent searches that have been performed. If you share a PC and don't want others to see what you've searched for, you can turn off the recent searches feature:


1. In the Start menu's Search box, type GPEDIT.MSC and press Enter to launch the Group Policy Editor.

2. Go to User Configuration --> Administrative Templates --> Windows Components --> Windows Explorer.

3. Double-click "Turn off display of recent search entries in the Windows Explorer search box" and select Enabled from the screen that appears. Then click OK. The recent searches feature will now be turned off.

Set a New Windows Explorer Launch Folder


When you run Windows Explorer, it always opens to the Libraries folder. That's fine if you use Microsoft's default file organization, which designates Libraries as the overall container for your folders. But what if you don't? You might prefer to have Windows Explorer open to Computer or any other folder you choose. Here's how to do it:

1. Right-click the Windows Explorer icon on the taskbar (it's the one that looks like a folder), and then right-click the Windows Explorer icon from the context menu that appears and select Properties. The Windows Explorer Properties dialog box appears.


2. You'll have to edit the Target field on the Shortcut tab of this dialog box in order to change the default location at which Explorer opens.

If you want Explorer to open to a specific folder, simply enter the name of the folder, substituting your folder name for Folder, below, like this:

%windir%\explorer.exe c:\Folder

So to open Explorer to the folder named Budget, you would type this in the Target field:

%windir%\explorer.exe c:\Budget

If you want Explorer to open to special, pre-set locations, such as Computer, you'll need to enter special syntax in the Target field. Following is a list of three common locations and the syntax to use, followed by the syntax for the Libraries folder in case you ever want to revert to the default.

•Computer: %windir%\explorer.exe ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}

•My Documents: %windir%\explorer.exe ::{450D8FBA-AD25-11D0-98A8-0800361B1103}

•Network: %windir%\explorer.exe ::{208D2C60-3AEA-1069-A2D7-08002B30309D}

•Libraries: %SystemRoot%\explorer.exe

3. After you've changed the Target field, click OK. Next time you launch Windows Explorer, it will open to the new location you've designated.

Show all Your Drives in Windows Explorer


Depending on your system settings, when you go to Computer in Windows Explorer, you may be in for a shock -- you may not see all your drives such as memory card readers if those drives are empty. If this disconcerts you, there's a simple way for you to see them even if there's nothing there:

1. Launch Windows Explorer and press the Alt button to reveal the top menu.


2. Select Tools --> Folder Options and click the View tab.

3. Under "Advanced settings," uncheck the box next to "Hide empty drives in the Computer folder." Click OK. The drives will now always be visible.


Build Your Own Internet Search Connector

Windows 7 has a very useful new feature called a Search Connector that lets you search through a Web site from right inside Windows Explorer. With it, you type in a search term and select the Search Connector for the site you want to search; Explorer searches the Web site without having to open Internet Explorer, and the results appear inside Windows Explorer. Click any of the results to head there using your default Web browser.

Normally, you'll need to get each Search Connector from the Web site through which you want to search, and very few Connectors are available. Sites normally need to adhere to OpenSearch standards in order for their Connectors to work.

However, there's a work-around that will let you easily build your own Search Connector for any site, using Windows Live Search as a kind of go-between. Don't worry, you don't need to know any code to write a Connector. Just follow these steps:

1. Copy the following text and paste it into Notepad. The text you'll need to change is in bold, all-caps text:





NAME YOUR SEARCH
DESCRIPTION OF SEARCH




2. In place of NAME YOUR SEARCH, type in the name of the search as you want it to appear. In our case, we're going to build a Search Connector for Computerworld, so we'll just type in Computerworld.


3. In place of DESCRIPTION OF SEARCH, type in a longer description of the search. In our instance, it will be Search through Computerworld.

4. In the two SITENAME.COM entries, enter the Web site's domain. Don't use the http:// or www -- just the domain name. In our instance it will be computerworld.com.

5. To the right of "count=", type in the number or results you want to appear. In our instance, we'll keep it at 50.

6. In our example, here's what the code should look like (no bold necessary):


Computerworld
Search through Computerworld




Taskbar Tips


One of the most significant changes to the Windows 7 interface is its new taskbar, which acts more like the Mac OS X dock than the Windows taskbar of old. Here are a few quick tips for using the new taskbar and tweaks for taking charge of it.

Speed Up the Display of Thumbnails on the Taskbar

One of the nicest things about the taskbar is that when you hover your mouse over the icons in it, you can see thumbnail previews of all open windows for each of those applications. When you do so, there is a slight delay before the thumbnail appears. But you can make the thumbnails display more quickly by using a Registry hack.

Important: Always create a Restore Point before editing the Windows Registry.

1. Launch the Registry Editor by typing regedit in the Search box and pressing Enter.


2. Go to HKEY_CURRENT_USER\Control Panel\Mouse.

3. Double-click MouseHoverTime. The default value you'll see is 400 -- which means 400 milliseconds. Type in a new, smaller value -- 150 is a good bet. Then click OK and exit the Registry Editor. You'll have to log off or restart your computer for the change to take effect.

Rearrange Taskbar Icons

It's easy to rearrange the icons across the bottom of the screen -- simply drag an icon to where you want it to live. You can also add icons to the taskbar by dragging them from an application, and delete the icons by highlighting them and pressing the Delete key.

Take Control of the Taskbar Notification Area

The notification area, at the far right of the taskbar, shows system messages and alerts, and displays the icons of programs and services that typically run in the background, such as Windows 7's wireless service. But what determines when, how and which icons show up there seems one of Windows' great mysteries.
There's a simple way to find out, and better yet, to customize it.


1. Right-click the taskbar, select Properties, and from the dialog box in the notification area section, click Customize.

2. For each application, select from the drop-down box whether you want the icon and notifications to always be displayed, to never be displayed or to have an icon appear only when there's a notification of some kind. Click OK when you're done.

You can also customize the system icons and services that appear there, including the clock, volume, network, power and Action Center icons. At the bottom of the same screen, click "Turn system icons on or off," and from the screen that appears, choose whether to turn on or off the icon and notifications. Click OK twice when you're done.

See Taskbar Thumbnails Without a Mouse

If you're a fan of using the keyboard rather than your mouse whenever possible, you can move your cursor from icon to icon in the taskbar without a mouse -- and still see thumbnail previews. Press Windows key-T, and you'll move the focus to the leftmost icon on the taskbar. Then, while still pressing the Windows key, press T again to change the focus to the next icon to the right. You can keep doing this as long as you like.

Launch Taskbar Apps Without a Mouse

Likewise, you can launch any program on the taskbar without the mouse. Press the Windows key and the number that corresponds to the position of the application on the taskbar -- for example, Windows key-1 to launch the left-most application on the taskbar, Windows key-2 to launch the second left-most application and so on.

Run Multiple Copies of Applications from the Taskbar

The Windows 7 taskbar serves a dual purpose, which can get confusing at times. It's used to launch programs, and also to switch between programs that are running. So you launch a program by clicking its icon, and also switch to that program after it's running by clicking its icon.

But what if you want to launch a second instance of the program? Once the program is running, it seems there's no way to launch a second instance, because when you click its icon, you only switch to the running instance.

There's a simple fix: If a program is already running and you want to launch a second instance from the taskbar, hold down the Shift key and click the icon. A second instance will launch. You can keep launching new instances this way.

Get back the Quick Launch bar

Windows 7's new taskbar functions as a program launcher as well as task switcher. As a result, the old Quick Launch bar, the area on the left side of the taskbar that contained shortcuts for frequently used programs, has been banished. However, if you really miss the little applet, you can add it back. Here's how to do it:

1. Right-click the taskbar and choose Toolbars --> New Toolbar.

2 . You'll be asked to select a folder for where the new toolbar should live. In the Folder text box at the bottom of the dialog box, enter this text:

%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch

After you do that, click Select Folder. A link for the Quick Launch bar will be added to the taskbar. It will be on the right of the taskbar, just to the left of the Notification area.

It's not particularly useful docked all the way to the right with no application icons showing, so we're going to have to do a bit of work on it to make it useful. Right-click the taskbar and, in the pop-up menu, remove the check next to "Lock the taskbar." Now right-click Quick Launch and remove the checks next to Show Text and Show Title.


Once you've done that, drag the vertical triple dotted line next to the Quick Launch bar to the left until you expose its icons. To prevent further changes, right-click the taskbar and check Lock the taskbar. You can now use the Quick Launch bar as you could in Windows XP and Vista, including adding icons to it and deleting them.

Fire an ASP.NET Validator from JavaScript (CustomValidator as well)

ValidatorEnable(clientIdOfCustomValidator,true/false);


When you call ValidatorEnable(clientIdOfCustomValidator,true), it will enable the client validator and fire up client validator function.


When you call ValidatorEnable(clientIdOfCustomValidator,false), it will disable the client validator and also remove the validation message from UI if it displayed.

You can call a validator to validate by using the following code:

ValidatorValidate('myValidatorID');
 
If you want to see more, just have a look at the WebUIValidation.js file that is somewhere in you system (just search for it).

Wednesday, July 13, 2011

SQL Server Reporting Services (SSRS) Interview questions and answers : 6

21. How do you reference an embedded function in a report expression?


Use the Code prefix and the name of the function to reference an embedded function in a report expression.

22. Which of the following are valid options for deploying a report? (Choose all that apply.)

a. With BIDS

b. With the Computer Management console

c. With the .nET START command

d. With SSMS

e. With Report Manager

The correct answers are a and e, BIDS and Report Manager.

23. Why should you not overwrite a shared data source in production?

You should not overwrite a production-shared data source because the administrator has probably already changed some connection string properties.

24. Can you edit a report that an end user created by using Report Builder in BIDS?

Yes, if an end user created a report by using Report Builder in BIDS and saved the report definition file, you can open the file in BIDS and edit it.

25. How can you manage reports from your application if the report server is deployed in SharePoint integrated mode?

Use the ReportService2006 endpoint of the SSRS Web service if your report server is deployed in SharePoint integrated mode.

26. In which processing mode of a report viewer control can you use the full functionality of your report server?

You should use the remote processing mode to use the full functionality of your report server.

27. What types of roles are available in SSRS 2008, and what are their purposes?

Item-level roles and system-level roles are the two types of roles available in SSRS 2008. An item-level role is a collection of tasks related to operations on an object of the report object hierarchy of SSRS 2008. A system-level role is a collection of tasks related to operations on server objects outside the report object hierarchy of SSRS 2008.

28. Can a user or group belong to more than one item-level or system-level role?

Yes, in SSRS 2008, a user or group can have more than one association to a system-level or an item-level role.

29. When storing the credentials of a data source in the server, are those credentials safe?

Yes, the data source credentials are safe because Reporting Services encrypts them and stores them in the ReportServer SQL Server database.

30. What happens if you do not specify a parameter value in a subscription and the parameter does not have a default value?

If you do not specify a parameter value in a subscription and the parameter does not have a default value, the execution of the report will fail.

31. You want to create a subscription to a report. However, when you right-click the Subscription subfolder of the report, you notice that the new Subscription option is dimmed. What is wrong?

When the new Subscription option is dimmed, the report probably does not use stored credentials for accessing the data. SSRS needs these credentials stored in its own ReportServer database to execute a report on a schedule.

32. What can you do if your query with properties for a data-driven subscription does not provide values for all of the subscription properties?

If your query with properties for a data-driven subscription does not provide values for all of the subscription properties, you can use text and default values instead. These values are then used for parameters of all subscriptions you get from the query.

33. What mechanisms do you identify to reduce the overhead of Reporting Services data sources?

Snapshots and cached reports can help reduce the processing pressure on data sources and improve report response time.

34. Can you always create a cache of a report?

No, you can create a cache of a report only when certain requirements, such as having credentials stored in the Report Server, are met.

35. Can you edit the .rdl code associated with a linked report?

No, because a linked report has no .rdl code of its own. It refers to the .rdl code of the base report.

36. Which of the tools and utilities described in this lesson can change or create the virtual directories for the report server and Report Manager after installation?

Only Reporting Services Configuration Manager can enable and name the virtual directories for the report server and Report Manager.

37. What is the file name extension for an encryption key backup?

Encryption key backups have an .snk file name extension.

38. What are the three SSRS command-line utilities and their primary functions?

RSConfig.exe is used to define the connection properties from the SSRS instance to the Report Server database; RSKeyMgmt.exe performs encryption key operations and scale-out deployment setup; RS.exe runs Report Server Script files that can perform report deployment and management operations.

39. If you want to disable one of the rendering options in the Save As drop-down list when viewing a report through Report Manager, where do you do that?

The visibility property for any of the rendering devices can be changed by modifying the RSReportServer.config file and locating the tag for the specific device.