.Net

11
What is .NET Framework .NET is a "Software Platform". It is a language-neutral environment for developing rich .NET experiences and building applications that can easily and securely operate within it. When developed applications are deployed, those applications will target .NET and will execute wherever .NET is implemented instead of targeting a particular Hardware/OS combination. The components that make up the .NET platform are collectively called the .NET Framework. The .NET Framework is a managed, type-safe environment for developing and executing applications. The .NET Framework manages all aspects of program execution, like, allocation of memory for the storage of data and instructions, granting and denying permissions to the application, managing execution of the application and reallocation of memory for resources that are not needed. The .NET Framework is designed for cross-language compatibility. Cross-language compatibility means, an application written in Visual Basic .NET may reference a DLL file written in C# (C-Sharp). A Visual Basic .NET class might be derived from a C# class or vice versa The .NET Framework has two main components: the common language runtime (CLR) and .NET Framework class library. The CLR is the foundation of the .NET framework and provides a common set of services for projects that act as building blocks to build up applications across all tiers. It simplifies development and provides a robust and simplified environment which provides common services to build application. The .NET framework class library is a collection of reusable types and exposes features of the runtime. It contains of a set of classes that is used to access common functionality. What is CLR? The .NET Framework provides a runtime environment called the Common Language Runtime or CLR. The CLR can be compared to the Java Virtual Machine or JVM in Java. CLR handles the execution of code and provides useful services for the implementation of the program. In addition to executing code, CLR provides services such as memory management, thread management, security management, code verification, compilation, and other system services. It enforces rules that in turn provide a robust and secure execution environment for .NET applications. Difference between vb.net and vb 61. vB 6 programs require significant modification to run under VB .NET 2. VB6 was interpreter based language while VB.NET is a compiled language 3. VB6 used the VB-Runtime while VB .NET adheres to the Common Language Specification (CLS) for language interoperability which is also shared with C#. 4. VB 4, 5, and 6 were backward compatible VB .NET is not backward compatible 5. VB6 was not a type-safe language while VB.NET is a type safe language. 6. VB6 used the ‘On Error Goto’ syntax to handle exceptions at runtime. VB.NET uses the Try…Catch…Finally syntax to handle exceptions at runtime. 7.A lot of code (like user interface code) in VB6 was hidden from developer. In VB.NET no code is hidden from developer and you can access and control each part of your application 8. VB6 does not allow developing the multithreaded applications. In VB.NET you can create multithreaded applications. 9. VB6 was only considered good for desktop windows application. In VB.NET you can develop web applications, distributed applications, create .NET windows and web controls and components, write windows and web services.

Transcript of .Net

Page 1: .Net

What is .NET Framework .NET is a "Software Platform". It is a language-neutral environment for developing rich .NET experiences and building applications that can easily and securely operate within it. When developed applications are deployed, those applications will target .NET and will execute wherever .NET is implemented instead of targeting a particular Hardware/OS combination. The components that make up the .NET platform are collectively called the .NET Framework. The .NET Framework is a managed, type-safe environment for developing and executing applications. The .NET Framework manages all aspects of program execution, like, allocation of memory for the storage of data and instructions, granting and denying permissions to the application, managing execution of the application and reallocation of memory for resources that are not needed. The .NET Framework is designed for cross-language compatibility. Cross-language compatibility means, an application written in Visual Basic .NET may reference a DLL file written in C# (C-Sharp). A Visual Basic .NET class might be derived from a C# class or vice versa The .NET Framework has two main components: the common language runtime (CLR) and .NET Framework class library. The CLR is the foundation of the .NET framework and provides a common set of services for projects that act as building blocks to build up applications across all tiers. It simplifies development and provides a robust and simplified environment which provides common services to build application. The .NET framework class library is a collection of reusable types and exposes features of the runtime. It contains of a set of classes that is used to access common functionality.  What is CLR?The .NET Framework provides a runtime environment called the Common Language Runtime or CLR. The CLR can be compared to the Java Virtual Machine or JVM in Java. CLR handles the execution of code and provides useful services for the implementation of the program. In addition to executing code, CLR provides services such as memory management, thread management, security management, code verification, compilation, and other system services. It enforces rules that in turn provide a robust and secure execution environment for .NET applications.  Difference between vb.net and vb 61. vB 6 programs require significant modification to run under VB .NET2. VB6 was interpreter based language while VB.NET is a compiled language3. VB6 used the VB-Runtime while VB .NET adheres to the Common Language Specification (CLS) for language interoperability which is also shared with C#.4. VB 4, 5, and 6 were backward compatible VB .NET is not backward compatible5. VB6 was not a type-safe language while VB.NET is a type safe language.6. VB6 used the ‘On Error Goto’ syntax to handle exceptions at runtime. VB.NET uses the Try…Catch…Finally syntax to handle exceptions at runtime.7.A lot of code (like user interface code) in VB6 was hidden from developer. In VB.NET no code is hidden from developer and you can access and control each part of your application8. VB6 does not allow developing the multithreaded applications. In VB.NET you can create multithreaded applications.9. VB6 was only considered good for desktop windows application. In VB.NET you can develop web applications, distributed applications, create .NET windows and web controls and components, write windows and web services. what is the difference between .net java The Major Difference between .Net and Java is 1)Java is a purely Platform independent means the application that will work in any kind of Operating System.But .Net is platform independt

Page 2: .Net

software. 2).Net support to develop application in different languages and to develop application Rapidly. This feature is not exist in Java NET and Java are incomparable guided by the fact that .NET is a framework or simply a platform of presently 43 programming languages,where as Java is a programming language. Java is platform independent on the otherhand .NET is language independent ie applications written in any programming language supported by .NET framework can be converted to any other language supported by the framework.(languages supported are VB.NET,C#.NET,J#.NET etc)  Data type specificsBooleanBoolean is really a flag and not a numeric data type. The storage size is 16 bits in VB6 and varies by platform in .NET.Integer and LongInteger and Long have the same name and type character in VB6/VBA and VB.NET, but they are different data types altogether. To stay clear one can use Int16, Int32 and Int64 in .NET.CurrencyCurrency is a 64-bit integer divided by 10000. It is only available in VB6/VBA. In VB.NET one can replace it with Decimal, which provides more capability.LongLongIntroduced with Office 2010, LongLong is a 64-bit signed integer that is available in VBA7 running on a 64-bit platform. It is unsupported in VB6, VBA6 and on 32-bit platforms.DecimalDecimal is a signed 96-bit integer, which is divided by a scaling factor.DoubleDate and time valuesDates and times are closely related to numeric data types, especially in VB6.VB6 date and timeVB6 stores dates and times in the Date data type. Date can store either the calendar date, the time of day, or both. Advantages and Disadvantages of .net Advantages:Less time to produce productLess Complexity.Easily to access complex O.S functionsEasily to build Data Oriented Project;Support huge DB functions.ManagedSupport Both Windows and Web Application.Easy to create Dynamic sites.Many languages available, both dynamic (IronPython and IronRuby) and static (C#, VB.NET, C++), both object oriented (C#, VB.NET, C++) and functional (F#)Newest technology from MS for app development DisadvantagesMulti platform support isn't available from MS and isn't available straight after installing Visual Studio Managed code can be slower than native codeNot suitable for High End ApplicationLow performance compare to C,C++.Unavailability of build in methods..NET framework is free to download but Code Editor is costly.Only few O.S supports .NET Software development models

Page 3: .Net

Several models exist to streamline the development process. Each one has its pros and cons, and it's up to the development team to adopt the most appropriate one for the project. Sometimes a combination of the models may be more suitable.Waterfall modelMain article: Waterfall modelThe waterfall model shows a process, where developers are to follow these phases in order:

1. Requirements specification (Requirements analysis)2. Software design3. Implementation and Integration4. Testing (or Validation)5. Deployment (or Installation)6. Maintenance

 Software development activities PlanningAn important task in creating a software program is extracting the requirements or requirements analysis [1]. Customers typically have an abstract idea of what they want as an end result, but not what software should do. Skilled and experienced software engineers recognize incomplete, ambiguous, or even contradictory requirements at this point. Frequently demonstrating live code may help reduce the risk that the requirements are incorrect.Once the general requirements are gathered from the client, an analysis of the scope of the development should be determined and clearly stated. This is often called a scope document.Certain functionality may be out of scope of the project as a function of cost or as a result of unclear requirements at the start of development. If the development is done externally, this document can be considered a legal document so that if there are ever disputes, any ambiguity of what was promised to the client can be clarified. ImplementationImplementation is the part of the process where software engineers actually program the code for the project. testingSoftware testing is an integral and important phase of the software development process. This part of the process ensures that defects are recognized as soon as possible. documentingDocumenting the internal design of software for the purpose of future maintenance and enhancement is done throughout development. This may also include the writing of an API, be it external or internal. The software engineering process chosen by the developing team will determine how much internal documentation (if any) is necessary.Plan-driven models (e.g., Waterfall) generally produce more documentation than Agile models. DeploymentDeployment starts after the code is appropriately tested, approved for release, and sold or otherwise distributed into a production environment. This may involve installation, customization (e.g. by setting parameters to the customer's values), testing, and possibly an extended period of evaluation.Software training and support is important, as software is only effective if it is used correctly. maintenanceMaintaining and enhancing software to cope with newly discovered faults or requirements can take substantial time and effort, as missed requirements may force redesign of the software  Backend and frontend

Page 4: .Net

In simple term, application front end is what you see (ie the user interface) and application back end is the application engine that you do not see.front end application is the client application and the back end application is the application that resides on the server (server application).Front end and Back end are IT terminologies...which basically means the lanuage and supporting supporting database of a program.Anything to do with the logic, algorithms etc comes in frontend.To bear significance to the developed application there has to be database which loads the program with the relevant data and which is worked upon and processed. This data has to be supported by a platform which keeps it for a storage and reference function and without which the working could not be possible because the data is the food for software..So this platform is called the "backend" of the program/software. What are various types of control available in VB?Ans. (A) Intrinsic control:The control that always found on toolbox.(B) Active X control:It is interactive objects that can reside on any form thatsupport OCX (OLE control) controls. e.g. Some standard Active X controlsare: ADO Data Control, Data List, Common Dialog etc.(C) Insertable Objects: In this, other objects can be added to the toolbox such asMicrosoft Excel etc Write any two database related Activex controls in VB?DBGrid, DBCombo, DBList,ADODC What is the use Locked property in a text box control in VB 6.0?When the locked property is set the user can be prevented from changing the contents of thetextbox. On the other hand it is possible to copy the value from the textbox Explain ActiveX controls.Active X controls are known as programmer built control can be used in VBapplication. ActiveX is a Microsoft term refer to group or components that includecontrols, DLL and active X documents. Steps involved in ActiveX controls:  High level design to determine what you want to do.  Use the other controls as building blocks.  Start new VB ActiveX project and draw the interface  Add code to enable  Build the test project.  Compile your control to OCX file. Advantage of ActiveX controls:  When you add a existing control t your new control you get existing one  Compile the controls a s a single unit  User can easily under stand the control.Using the ActiveX control interface:  Start a new ActiveX control project.  Set the name and size  Start the wizard by choosing the ActiveX control interface.  Click next to start the work of setting the property Briefly explain MDI.MDI allows the program to work with multiple forms contained within the parent form  one container form act as a parent form  User can work with multiple documents. How you add control array in a formControl array is a group of controls all of the same type that have the same nameand are identified by a integer.Control array elements:

Page 5: .Net

Each in individual control in the array is referred to as an element.  Must be of same type  Must have same value for name  Unique value for index property. Advantage:control array require limited system requirements  Share a common set of event procedure  Adding control while the form is running Creating control array: Add a control in the form and then copy 1 control  Change the name property of the control.  Set the index property to a number What is a Form?A form is a representation of any window displayed in your application. Form can be used to create standard, borderless, floating, modal windows. What does following statements do in VB?Ans.Show: - Display a form that is currently not visible. This methodautomatically loads the form, if it is not loaded in memory already.Load: - used to load a form in memory programmatically.Unload: - Used to remove a form from memory and release the memory space itwas occupy, in loaded state.Hide: - Used to make a visible form invisible. The hidden form continues toreside in memory Name the three file system controls?Ans.(1) Drive List Box(2) Directory List Box(3) File List Box Q21.What is a ToolBar?Ans.A ToolBar is a container for buttons that generally correspond to frequentlyused commands in an application’s menu. Q22.What is a StatusBar?Ans.StatusBar is a frame that contains various panels to inform the user aboutthe status of an application. Q23.What is a Status Bar Panel?Ans.It is a section of status bar that is used to display information about aparticular attribute of the application. Q24.What is Separator Bar?Ans.A bar on a menu that divides menu items into logical group is called aSeparator Bar. It is used fro clarity and for dividing logically related menuitems into logical groups. Q25.What are dynamic menus?Ans.Dynamic menus are menus to which menu items can be added or removed atruntime. Q26.What is OLE?Ans.OLE stands for object linking and Embedding. OLE is a way to link differentapplications. The application whose object is placed in other application iscalled source document and the document where this object is placed is called thedestination document. Q27.What is embedded object?Ans.Embedded object is an object in a destination document that is a copy ofinformation, created in another application IconTool NameWhat This Tool Does

Page 6: .Net

 PointerSelects objects Picture boxDraws a box to display graphics LabelDraws a box to display text Text boxDraws a box that can display text and let the user type in text FrameGroups two or more objects together Command buttonDraws a command button Check boxDraws a check box Option (or radio) buttonDraws a radio button Combo boxDraws a combo box List boxDraws a list box Horizontal scroll barDraws a horizontal scroll bar Vertical scroll barDraws a vertical scroll bar TimerPlaces a timer on a form Drive list boxDraws a drive list box that displays all the disk drives available Directory list boxDraws a directory list box that displays a directory on a particular disk drive File list boxDraws a file list box that displays files in a specific directory ShapeDraws a geometric shape such as a circle or a square LineDraws a line Image boxDraws a box to display graphics 

Page 7: .Net

Data controlDraws a control to link a program to a database file OLEDraws a box to insert an OLE object  There are 47 basic tools in the Toolbox:Pointer:This is the only item in the Toolbox that doesn't draw a control. It is used toresize or move a control after it's been drawn on a form. Label: Used for text that you don't want the user to change, such as a caption under agraphic. Link Label: A Hyperlink label Command Button: Used to create a button that the user can choose to carry out acommand. Text Box: Used to hold text that the user can either enter or change. Main Menu: Adds menus under the titles bar of the form. i.e. File, Edit, … Check Box: Used to create a box that the user can easily choose to indicate if somethingis true or false, or to display multiple choices when the user can choose more thanone. Radio Button: Used in a group of option buttons to display multiple choices from whichthe user can choose only one. Group Box: Typically used to serve as a border for control with similar needs Picture Box: Used to display graphical images (either decorative or active), as acontainer that receives output from graphics methods, or as a container for othercontrols. Panel: Used to host or hold other controls that belong to the same group Datagrid: Allows users see and edit multiple rows of data simultaneously, also useful forrapid entry of large amounts of data List Box: Used to display a list of items from which the user can choose one. The list canbe scrolled if it has more items than can be displayed at one time Checked List Box: Allows the user to select multiple items in a list by providing a checkbox for each item. Combo Box: Used to draw a combination list box and text box. The user can eitherchoose an item from the list or enter a value in the text box. List View: Displays a list of items with icons, similar to Windows explorer. Tree View: Displays a hierarchy of nodes, like files and folders. Tab Control: Allows the user to add multiple tabs to a form, like dividers in a notebook. Date Time Picker: Allows the user to select a single item from a list of dates or times. Month Calendar: Displays a calendar that allows the user to change months and select adate 

Page 8: .Net

Horizontal Scroll Bar: Used to provide a graphical tool for quickly navigating through along list of items or a large amount of information, for indicating the currentposition on a scale, or as an input device or indicator of speed or quantity. Vertical Scroll Bar: Used to provide a graphical tool for quickly navigating through along list of items or a large amount of information, for indicating the currentposition on a scale, or as an input device or indicator of speed or quantity. Timer: Used to generate timer events at set intervals. This control is invisible at run time. Splitter: To resize docked controls at runtime. Domain Up Down: Basically a textbox with two buttons for moving up and down in alist Numeric Up Down: Same as DomainUpDown, except the list is composed of numbersand the up and down arrows adjust the value of the control Track Bar: Also called a slider. Used to move through vast amounts of data, or visuallyadjust a number. Progress Bar: Set to indicate the progress of a process by displaying the status in theform of small rectangles in a long rectangle. Rich Text Box: A textbox that uses .rtf format. Image List: Just like it sounds, a list of images. The list can be navigated by a button thatscrolls through the imagesHelp Provider: Brings up the help window. Tool Tip: Used to display text when the user moves the mouse over a control. Context Menu: Displays a menu of frequently used commands associated with theselected item Tool Bar: Allows the programmer to add a toolbar to his form Status Bar: Used to allow an application to display various information about its status Notify Icon: Used for processes that run in the background, and most of the time don’tneed an interface with the user. A good example would be virus protectionsoftware. Open File Dialog: Brings up the window that allows the user to select a file for opening Save File Dialog: Opens the window that lets the user select the location and name of thecurrent open file Font Dialog: Brings up the font selection window Color Dialog: Allows the user to choose the current font color Print Dialog: Brings up the typical Windows print menu Print Preview Dialog: Opens the menu window for Print Preview settingsPrint Preview Control: Opens print preview with the default settings Error Provider: Provides a non-intrusive way of showing that there is an error with theinput or in a data set. An exclamation mark in a red square is displayed next to theerror Print Document: Prints the current document with the default printer settings 

Page 9: .Net

Page Setup Dialog: Opens the window that allows the user to adjust page settings likemargins, headers and footers, and orientation.  For....Next LoopThe format is:  For counter=startNumber to endNumber (Step increment)    One or more VB statementsNext For counter=1000 to 5 step -5  counter=counter-10   Next*Notice that increment can be negative For  counter=1 to 10  display.Text=counter  Next Do Loop The formats are a)   Do While condition            Block of one or more VB statements      Loop b)   Do             Block of one or more VB statements       Loop While condition c)    Do Until condition               Block of one or more VB statements        Loop d)    Do              Block of one or more VB statements       Loop Until condition Example 9.1        Do while counter <=1000             num.Text=counter             counter =counter+1       Loop* The above example will keep on adding until counter >1000.The above example can be rewritten as        Do               num.Text=counter                counter=counter+1       Loop until counter>1000  Example 9.2 Dim sum, n As Integer Private Sub Form_Activate()List1.AddItem "n" & vbTab & "sum"Do   n = n + 1   Sum = Sum + n List1.AddItem n & vbTab & Sum If n = 100 Then Exit Do End If

Page 10: .Net

  LoopEnd Sub http://www.go4expert.com/forums/showthread.php?t=3696 DoRequired. Starts the definition of the Do loop.WhileRequired unless Until is used. Repeat the loop until condition is False.UntilRequired unless While is used. Repeat the loop until condition is True.Exit DoOptional. Transfers control out of the Do loop.LoopRequired. Terminates the definition of the Do loop.  select caseDim grade As StringPrivate Sub Compute_Click( )grade=txtgrade.TextSelect Case grade  Case  "A"        result.Caption="High  Distinction"  Case "A-"       result.Caption="Distinction"  Case "B"         result.Caption="Credit"  Case "C"         result.Caption="Pass"  Case Else         result.Caption="Fail"  End SelectEnd Sub Dim number As Integer = 8Select Case numberCase 1 To 5Debug.WriteLine("Between 1 and 5, inclusive")' The following is the only Case clause that evaluates to True.Case 6, 7, 8Debug.WriteLine("Between 6 and 8, inclusive")Case 9 To 10Debug.WriteLine("Equal to 9 or 10")Case ElseDebug.WriteLine("Not between 1 and 10, inclusive")End Select