Visual
Visual
NET
Integrated Information Systems
Mike Helstrom Solution Architect [email protected]
Agenda
What is .NET? .NET Framework Visual Studio.NET C# Visual Basic.NET Q&A
http://www.microsoft.com/net/
Web site
Looselycoupled, services connected by XML-based messages Web and contracts, written in many languages
Service
Backend App
Service
Mega Service
site
Device
XMLmsgs
Web site
Mega Service
http://www.microsoft.com/business/vision/netvision.asp
.NET Framework
.NET Framework
.NET Framework consists of 3 main parts:
Common Language Runtime Framework Classes/Libraries ASP.NET
http://msdn.microsoft.com/net
VB
C++
C#
JScript
Visual Studio.NET
Common Language Specification ASP.NET: Web Services and Web Forms Windows Windows Forms Forms
ADO.NET: Data and XML Base Class Library Common Language Runtime
Language/Hardware/OS Independent
Compact framework for small devices
Unified Classes
Web Classes (ASP.NET)
Controls, Caching, Security, Session, Configuration etc
Data (ADO.NET)
ADO, SQL,Types etc
Windows Forms
Design, Cmpnt Model etc
XML Classes
Drawing Classes
System Classes
Collections, Diagnostics, Globalization, IO, Security, Threading Serialization, Reflection, Messaging etc
ASP.NET
ASP.NET is a new programming framework designed to make web apps easier to:
Build, Deploy, Run
Richer XML features and integration XCopy/FTP deployment Better reliability and recovery Excellent Visual Studio designer support
ASP.NET
ASP.NET is compiled, not interpreted Better performance Early binding, strong typing, JIT compiling to native code Configuration settings in XML-based files Session state can now be shared across a web farm of ASP.NET servers .NET State Server Process manages state Application state is still single sever ASP.NET detects and recovers from problems Access violations, memory leaks, deadlocks ASP.NET supports pre-emptive cycling of apps Time and request based settings
Visual Studio.NET
Visual Studio.NET
Integrated Development Environment
Visual Basic.NET
Many language enhancements Inheritance,Overloading, Free Threading
Visual C++
Integration with .NET Framework with managed extensions (classes)
C#
New development language Based on C/C++ with Garbage Collection/Memory Management
(1/25/01)
http://msdn.microsoft.com/vstudio
JUMP to .NET
Consists of 3 sets of tools and a service offering
Interoperability support Programming tools support Automated conversion from Java language source code to C# Migration services
VS.NET Features
Single IDE for all Languages Server Explorer
Event Viewer, Message Queues, Services SQL Databases, Data Connection, Etc.
Integrated IE Browser HTML/XML Editors Macros/Macro Explorer Solution Explorer Tabbed Documents Dynamic Help Common Forms Editor
VB.NET, C++, and C#
C#
Intro to C#
Design Goals of C#
Component Orientated Language Robust and Durable Software
Features
Classes Namespaces No header files
VB.NET vs. C#
Ability to embed C++ code in C# code Elegance of C/C++ language
Design Goals C#
Component Oriented
Properties, methods, events
Visual Basic.NET
Visual Basic.NET
Leave it in VB6
WebClasses, ActiveX Documents, DHTML Projects
Thinking in VB.NET
Data Types, Type vs. Structure Property Functions, Zero Bound Arrays Default Parameters
New Features
Forms Designer, Declaration Syntax Structured Exception Handling Overloading, Inheritance Free Threading
ADO.NET
VB.NET
Dim intAge As Short Dim intID As Integer
VB.NET
Structure Customer Public CustomerNumber as Integer Public CustomerName As String Public CustomerCompany As String End Structure
VB.NET
Public Property CustomerName() As String Get CustomerName = m_CustName End Get Set m_CustName = Value End Set End Property
VB.NET
txtAddress.Text = rs(Addr_1).value lblFName.Text = First Name
Note: Recordset (COM ADO) is not the preferred data storage object in VB.NET, this is just an example.
VB.NET Demo
VB.NET
Dim intLoop As Integer = 10
VB.NET
Try ... Catch error handling Finally clean up End Try
VB.NET: Overloading
Functions can now be overloaded (accept arguments of different types) VB.NET
Overloads 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 Property End Class
ADO.NET
ADO.NET is the preferred data access method in the .NET Framework Better support for disconnected data access Specialized namespaces
System.Data.SQL Tuned for SQL Server System.Data.ADO OLEDB
Portable
Native XML Support
ADO.NET
ADOConnection
Similar to Connection object in ADO
ADOCommand
Similar to Command object in ADO
ADODataSetCommand
Somewhat like Recordsets for ADO.NET (DataSet) Designed for stateless operations
ADODataReader
For streaming methods, similar to Stream
VB.NET Demo
VB 6 Moving Forward
Avoid
Web Classes, ActiveX Docs, DHTML Apps
Development Techniques
Early Binding Dont use Default Properties Use Constants (such as true) Avoid GoSub Use ByVal and ByRef explicitly (ByVal is now default) Use ADO
Resources
Microsoft
http://www.microsoft.com/net http://msdn.microsoft.com/net
Programmer Resources
http://www.gotdotnet.com http://www.devx.com
Example Site
http://www.ibuyspy.com
TechNet Briefing
Microsoft TechNet Briefing, Portland, ME 3/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.
Questions?
http://www.iisweb.com