Introduction to Visual Studio.NET
Integrated Information Systems
Mike HelstromSolution Architect
Agenda
What is .NET?.NET FrameworkVisual Studio.NETC#Visual Basic.NETQ & A
What is Microsoft .NET?
.NET represents an advanced new generation of software that will drive the Next Generation Internet. Its purpose is to make information available any time, any place, and on any device.Quick Definition
.NET is an initiative to integrate all Microsoft products with the “Next Generation” web.
http://www.microsoft.com/net/
Next Generation Internet
Web siteWeb site
Web siteWeb site
Web siteWeb site
BackendBackendAppApp
MegaMegaServiceService
BackendBackendAppApp
MegaMegaServiceService
Loosely-Loosely-coupled, coupled, services services connected by connected by XML-based XML-based messages and messages and contracts, contracts, written in many written in many languageslanguages
ServiceServiceDeviceDevice
XML-XML-msgsmsgs ServiceService
ServiceService ServiceService
What is Microsoft .NET? (Cont.)
Core components of .NET are:.NET Infrastructure and Tools.NET Services
An integrated set of building block services for the new Internet, including Passport.NET (for user authentication), and services for file storage, user preference management, calendar management, and many others.
.NET User ExperienceA broader, more adaptive user experience, where information is delivered in a variety of ways on a variety of different devices.
.NET Device SoftwareEnables a new breed of smart Internet devices that can leverage Web Services
http://www.microsoft.com/business/vision/netvision.asp
.NET Infrastructure and Tools
.NET Infrastructure and Tools.NET Enterprise Servers
SQL 2000Exchange 2000ISA 2000Host Integration Server 2000Application Center 2000BizTalk Server 2000Commerce Server 2000
Visual Studio.NET.NET FrameworkWindows.NET
“Whistler” (Windows XP)
.NET Framework
.NET Framework
.NET Framework consists of 3 main parts:
Common Language RuntimeFramework Classes/LibrariesASP.NET
http://msdn.microsoft.com/net
The .NET Framework
Base Class LibraryBase Class Library
Common Language SpecificationCommon Language Specification
Common Language RuntimeCommon Language Runtime
ADO.NET: Data and XMLADO.NET: Data and XML
VBVB C++C++ C#C#V
isual S
tud
io.N
ET
Visu
al Stu
dio
.NE
T
ASP.NET: Web ServicesASP.NET: Web Servicesand Web Formsand Web Forms
JScriptJScript ……
WindowsWindowsFormsForms
WindowsWindowsFormsForms
Common Language Runtime (CLR)
A common runtime for all .NET languagesCommon type systemCommon metadataIntermediate Language (IL) to native code compilersMemory allocation and garbage collectionCode execution and security
Over 15 languages supported todayC#, VB, Jscript, Visual C++ from MicrosoftPerl, Python, Smalltalk, Cobol, Haskell, Mercury, Eiffel, Oberon, Oz, Pascal, APL, CAML, Scheme, etc.
Rational is working on Java compiler for CLR
Common Language Runtime (CLR)
Enables cross-language interoperabilityCommon Language Specification describes interoperability requirements
Language/Hardware/OS IndependentCompact framework for small devices
Industrial strength Garbage collectorDesigned for multi-processor servers
CLR: Execution Model
VBVBSource Source codecode
CompilerCompiler
C++C++C#C#
CompilerCompilerCompilerCompiler
AssemblyAssemblyIL CodeIL Code
AssemblyAssemblyIL CodeIL Code
AssemblyAssemblyIL CodeIL Code
Operating System ServicesOperating System Services
Common Language RuntimeCommon Language Runtime
JIT CompilerJIT Compiler
Native CodeNative Code
ManagedManagedcodecode
UnmanagedUnmanagedComponentComponent
.NET Framework Libraries
Single consistent set of object oriented class libraries to enable building distributed web applications (Unified Classes)
Built using classes arranged across logical hierarchical namespaces
For example: System.Data.SQL
Work with all CLR languagesNo more “VBRun” or “MFC” divide
.NET Framework Libraries
Unified Classes
Web Classes (ASP.NET)
XML Classes
System Classes
Drawing Classes
Windows FormsData (ADO.NET)
Controls, Caching, Security, Session, Configuration etc
Collections, Diagnostics, Globalization, IO, Security,Threading Serialization, Reflection, Messaging etc
ADO, SQL,Types etc
Drawing, Imaging, Text, etc
Design, Cmpnt Model etc
XSLT, Path, Serialization etc
ASP.NET
ASP.NET is a new programming framework designed to make web apps easier to:
Build, Deploy, Run
Radical advancement of today’s ASPBroader programming language support
Visual Basic.NET, Jscript.NET, C#Easier page programming model
NamespacesRicher XML features and integrationXCopy/FTP deploymentBetter reliability and recoveryExcellent Visual Studio designer support
ASP.NET
ASP.NET is compiled, not interpretedBetter performanceEarly binding, strong typing, JIT compiling to native code
Configuration settings in XML-based filesSession state can now be shared across a web farm of ASP.NET servers
.NET State Server Process manages stateApplication state is still single severASP.NET detects and recovers from problems
Access violations, memory leaks, deadlocksASP.NET supports pre-emptive cycling of apps
Time and request based settings
Visual Studio.NET
Visual Studio.NET
Integrated Development EnvironmentVisual Basic.NET
Many language enhancementsInheritance,Overloading, Free Threading
Visual C++Integration with .NET Framework with managed extensions (classes)
C#New development languageBased on C/C++ with Garbage Collection/Memory Management
JUMP (Java User Migration Path) to .NET (1/25/01)
Visual J++ has been removed from the Visual Studio suite.
http://msdn.microsoft.com/vstudio
JUMP to .NET
Consists of 3 sets of tools and a service offering
Interoperability supportProgramming tools supportAutomated conversion from Java language source code to C#Migration services
VS.NET Features
Single IDE for all LanguagesServer Explorer
Event Viewer, Message Queues, ServicesSQL Databases, Data Connection, Etc.
Integrated IE BrowserHTML/XML EditorsMacros/Macro ExplorerSolution ExplorerTabbed DocumentsDynamic HelpCommon Forms Editor
VB.NET, C++, and C#
Visual Studio.NET Demo
C#
Intro to C#
Design Goals of C#Component Orientated LanguageRobust and Durable Software
FeaturesClassesNamespacesNo header files
VB.NET vs. C#Ability to embed C++ code in C# codeElegance of C/C++ language
Design Goals C#
Component OrientedProperties, methods, events
Robust and DurableGarbage collection (No memory leaks and stray pointers)Exception HandlingType-safety (No uninitialized variables)
Based on C++Interoperability
Support for XML, SOAP
Visual Basic.NET
Visual Basic.NET
Leave it in VB6WebClasses, ActiveX Documents, DHTML Projects
Thinking in VB.NETData Types, Type vs. StructureProperty Functions, Zero Bound ArraysDefault Parameters
New FeaturesForms Designer, Declaration SyntaxStructured Exception HandlingOverloading, InheritanceFree Threading
ADO.NET
VB.NET: Data Types
True is now = 1Integer Data type has changed
Short (Int16), Integer (Int32), Long (Int64)VB 6
VB.NET
Dim intAge As IntegerDim intID As Long
Dim intAge As ShortDim intID As Integer
VB.NET: Type vs. Structure
Defining user defined types (UDT) has a new syntaxVB 6
VB.NET
Type Customer CustomerNumber as Long CustomerName As String CustomerCompany As StringEnd Type
Structure Customer Public CustomerNumber as Integer Public CustomerName As String Public CustomerCompany As StringEnd Structure
VB.NET: Property Functions
VB 6
VB.NET
Public Property Get CustomerName() As StringCustomerName = m_CustName
End PropertyPublic Property Let CustomerName(sCustName As String)
m_CustName = sCustNameEnd Property
Public Property CustomerName() As String Get CustomerName = m_CustName End Get Set m_CustName = Value End SetEnd Property
VB.NET: Zero Bound Arrays
Option Base 1|0 has been removedAll arrays are base 0The following declaration has 5 elements, arrElements(0) thru arrElements(4)
Dim arrElements(5) As String
VB.NET: Default Properties
Default properties are no longer supported.Important! Early Binding is key in VB6VB 6
VB.NET
Note: Recordset (COM ADO) is not the preferred data storage object in VB.NET, this is just an example.
txtAddress = rs(“Addr_1”)lblFName = “First Name”
txtAddress.Text = rs(“Addr_1”).valuelblFName.Text = “First Name”
VB.NET Forms Designer
New Forms DesignerVB.NET, C++, C#
Enhanced Menu EditorControl AnchorsNew PropertiesVisual Inheritance
VB.NET Demo
VB.NET: New Declaration Syntax
Variables can now be declared and initialized on declaration line.VB 6
VB.NET
Dim intLoop As IntegerintLoop = 10
Dim intLoop As Integer = 10
VB.NET: Structured Exception Handling
VB.NET supports elegant error handlingVB 6
VB.NET
On Error Goto ErrTag ... ‘clean up Exit FunctionErrTag: ‘error handling ‘clean upEnd Function
Try ...Catch ‘error handlingFinally ‘clean upEnd Try
VB.NET: Overloading
Functions can now be overloaded (accept arguments of different types)VB.NETOverloads Function ConvertSQL(ByVal strString As String) As String ConvertSQL = "'" & strString & "'"End Function Overloads Function ConvertSQL(ByVal intNum As Integer) As String ConvertSQL = CStr(intNum)End Function
VB.NET: Inheritance
Public Class Customer Private m_CustName As String Public Property CustomerName() As String Get CustomerName = m_CustName End Get Set m_CustName = Value End Set End Property End Class
Public Class CustCompany Inherits Customer Private m_CustCompany As String Public Property CustomerCompany() As String Get CustomerCompany = m_CustCompany End Get Set m_CustCompany = Value End Set End PropertyEnd Class
ADO.NET
ADO.NET is the preferred data access method in the .NET FrameworkBetter support for disconnected data accessSpecialized namespacesSystem.Data.SQL – Tuned for SQL ServerSystem.Data.ADO – OLEDB
PortableNative XML Support
ADO.NET
ADOConnectionSimilar to Connection object in ADO
ADOCommandSimilar to Command object in ADO
ADODataSetCommandSomewhat like Recordsets for ADO.NET (DataSet)Designed for stateless operations
ADODataReaderFor streaming methods, similar to Stream
SQLConnection, SQLCommand, and SQLDataSetCommand, SQLDataReader
VB.NET Demo
VB 6 Moving Forward
AvoidWeb Classes, ActiveX Docs, DHTML Apps
Development TechniquesEarly BindingDon’t use Default PropertiesUse Constants (such as true)Avoid GoSubUse ByVal and ByRef explicitly (ByVal is now default)Use ADO
VB6 to VB.NET Conversion TechniquesRelax, take breaks often
Resources
Microsofthttp://www.microsoft.com/net
http://msdn.microsoft.com/net
Programmer Resourceshttp://www.gotdotnet.com
http://www.devx.com
VB6 to VB.NET Whitepaperhttp://msdn.microsoft.com/library/techart/vb6tovbdotnet.htm
Example Sitehttp://www.ibuyspy.com
TechNet Briefing
Microsoft TechNet Briefing, Portland, ME3/27/01 9:00AM – 12:00PM
Co-located at the Maine Technology Job Fair http://www.mainetechnologyjobfair.com/
Attendees receive a FREE copy of SQL Server 2000 Evaluation Edition (120 day) and ISA Enterprise Edition Evaluation (120 day). Topics include: Using Microsoft Project 2000 and Visio 2000 to plan and track your Windows 2000 deployment, and How to make full use of Office and Windows 2000 Web integration.
http://www.iisweb.com
Questions?
Top Related