Sns College of Technology
Total Page:16
File Type:pdf, Size:1020Kb
Reg.No SNS COLLEGE OF TECHNOLOGY (Autonomous) MCA- Internal Assessment –III (October 2019) A Academic Year 2019-2020(ODD) / Fifth Semester 16CA801 – C# and .NET Programming Time: 11/2 Hours Maximum Marks: 50 Answer All Questions PART - A (3 * 2 = 6 Marks) 1. Define the states in ASP.Net. CO4 (L4) View State. Control State. Session State. Application State. 2. Data sets are Objects – Justify. CO4 (L6) A Dataset object represents a group of fields (key / value pairs) used to autofill parts of a screen. 3. List the Protocols used in web services. CO5 (L3) 1. WSDL 2. SOAP 3. UDDP PART - B (2*4 = 8 Marks) 4. Describe Exception Handler in ASP.Net. CO4 (L4) try { int a = 0; int b = 9 / a; }catch (Exception e) { Trace.Warn("UserAction", "processing 9/a", e); } 5. Specify the components used in WWF with diagram CO5 (L3) Every running workflow instance is created and maintained by an in-process run- time engine that the host process interacts with through one of the following: A WorkflowInvoker, which invokes the workflow like a method. A WorkflowApplication for explicit control over the execution of a single workflow instance. A WorkflowServiceHost for message-based interactions in multi-instance scenarios. Each of these classes wraps the core activity runtime represented as a ActivityInstance responsible for activity execution. There can be several ActivityInstance objects within an application domain running concurrently. Each of the preceding three host interaction objects is created from a tree of activities referred to as a workflow program. Using these types or a custom host that wraps ActivityInstance, workflows can be executed inside any Windows process including console applications, forms-based applications, Windows Services, ASP.NET Web sites, and Windows Communication Foundation (WCF) services. Workflow components in the host process Interaction between Workflow Components PART – C (3*12 = 36 Marks) 6.(a) Demonstrate the creation of web based application with neat GUI. CO4 (L4) To create a Web application project 1. Open Microsoft Visual Studio. 2. On the File menu, select New Project. The New Project dialog box appears. 3. Select the Templates -> Visual C# -> Web templates group on the left. 4. Choose the ASP.NET Web Application template in the center column. 5. Name your project BasicWebApp and click the OK button. 6. Next, select the Web Forms template and click the OK button to create the project. Visual Studio creates a new project that includes prebuilt functionality based on the Web Forms template. It not only provides you with a Home.aspx page, an About.aspx page, a Contact.aspx page, but also includes membership functionality that registers users and saves their credentials so that they can log in to your website. When a new page is created, by default Visual Studio displays the page in Source view, where you can see the page's HTML elements. The following illustration shows what you would see in Source view if you created a new Web page named BasicWebApp.aspx. (OR) (b) Indicate the usage of Session Management in ASP.Net. CO4 (L5) Session state is a period of time to visit a website for a particular user. Session can store the client data on a server. Session is a best state management features to store the client data on server separately for each user. Session can store value across on multiple pages of website. Viewstate can store value on single page. In simple word we can say, At the same time more than one users login to system, all user identification name store separately until they logout. session can store username or any unique identification of user for a login period time. Session value can be accessible from all pages from website. We can store some information in session in one page and can access same information on rest of all page by using session. By default, Session state is enabled for all ASP.NET applications. string myvalue= Session[“name”].ToString(); Response.Write(“Name = ” + myvalue); 7.(a) Write down the steps to create web service using C#? Give an example CO4 (L3) 1. Open Visual Studio > File > New > Web Site… 2. Create “ASP.Net Empty Web Site” (name it“MyWebService”) and save at the desired location. 3. Right-click on Project folder in Solution Explorer on the right side > Add > New Item. 4. Select your language (C# in my case) > Web Service (ASMX) > Add. Now, name it (for example MyWebService.asmx). 1. WebMethod(MessageName = "twoparameter", Description = "addition of two inte gers")] 2. public int add(int a, int b) { 3. return (a + b); 4. } 5. [WebMethod(MessageName = "threeparameter", Description = "addition of thr ee integers")] 6. public int add(int a, int b, int c) { 7. return (a + b + c); 8. } 9. [System.Web.Script.Services.ScriptService] (OR) (b) Briefly describe about Windows Workflow Foundations. CO5 (L3) The .Net 3.0 RTM version was released earlier this week. .Net 3.0 consists of the following main components: . .Net Framework . Microsoft Windows Communication Foundation . Microsoft Windows Presentation Foundation . Microsoft Windows Workflow Foundation The Windows Workflow foundation provides a platform built on the .Net Framework for building workflows. It is not an application or a server product, and is included as a component of the .Net 3.0 framework. The platform unleashes the power of a completely different paradigm. Some of the major criteria for workflows are listed below: 1. Visual Representation of process(es) 2. Can be dynamically modified at run-time 3. Can be long-running There are two major types of workflows - Sequential workflows: used for well-defined, process workflows State Machine workflows: Organized as state machine diagrams, typically used for workflows with human interaction. Workflows can either be built declaratively by using only Markup, or only Code or a combination of both Markup and code. Once the workflow is developed, it can be hosted on any application that can load the Workflow Runtime such as Windows Forms, Windows Services, ASP.Net Web Sites and Web Services. 8.(a) List any three panels used in XAML with suitable example. CO5 (L5) Panels in XAML Grid Panel. Stack Panel. Dock Panel. Wrap Panel. Canvas Panel. Grid Panel: combination of row and column layout is a Grid Panel; in other words, a Grid Panel arranges controls in a tabular format. The functionality is similar to the HTML table but more flexible as in the following example we try to show a row and column combination for the windows. There are 4 rows and 4 columns. StackPanel StackPanel is a useful XAML layout. It keeps a control horizontal and vertical; using a stack we design the application like many controls. Stack Panel common properties are: Stack child element horizontally or vertically. Default is vertical. Use orientation to change to horizontal. Controls positioning of elements by setting their horizontal alignment or vertical alignment properties. Control spacing by setting a margin and padding properties of elements. Wrap Panel In a Wrap Panel the child elements are positioned sequentially, from left to right and top to bottom <WrapPanel Grid.Row="0" Grid.Column="0"> <Button Margin="10">Mango</Button> <Button Margin="10">Apple</Button> <Button Margin="10">Grape</Button> <Button Margin="10">Banana</Button> <Button Margin="10">Bilberry</Button> <Button Margin="10">Lemon</Button> </WrapPanel> (OR) (b) Outline the concept of Windows Presentation Foundations. CO5 (L3) WPF, which stands for Windows Presentation Foundation, is Microsoft's latest approach to a GUI framework, used with the .NET framework. A GUI framework allows you to create an application with a wide range of GUI elements, like labels, textboxes and other well known elements. Without a GUI framework you would have to draw these elements manually and handle all of the user interaction scenarios like text and mouse input. This is a LOT of work, so instead, most developers will use a GUI framework which will do all the basic work and allow the developers to focus on making great applications. XAMLPad To get developers started with XAML, Microsoft provides a useful tool known as XAMLPad. XAMLPad is a XAML editor that allows you to quickly preview your UI. To use XAMLPad, go to Start, choose Programs, choose Microsoft Windows SDK, then choose Tools, and finally choose XAMLPad. Figure 1 shows the various components in XAMLPad. Figure 1: The various components in XAMLPad. XAMLPad offers the following functions: Auto Parse - The Preview Pane (7) will be updated as you type your XAML code in (8) Refresh - Refreshes the Preview Pane (7) Changes the font in the Code Edit Pane (8) Changes the font size in the Code Edit Pane (8) Hides the Code Edit Pane (8) Changes the scaling factor of the Preview Pane (7) Preview Pane Code Edit Pane Status bar .