تعليم vb.net 2005 بسهولة + قاموس للمصطلحات اللغة

Upload: -

Post on 30-May-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 + VB.Net 2005

    1/220

  • 8/14/2019 + VB.Net 2005

    2/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    MicrosoftVisual Basic.Net 2005

    )(-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    3/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Content

    Introduction

    -

    -Net Framwork.

    2005Net.VB

    -Express2005Net.Visual Basic

    -IDE

    -

    -

    -

    BasicsProgramming

    ---

    -

    -

    -

    Applications

    -

    -PDF

    -

    -

    -

    -

    -

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    4/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    and ReportsDatabase

    -2005SQL Server

    -Programming2Net.ADO

    -ReportsCrystal Reports

    Help

    -Help

    -

    -SQL

    -2005Net.VB

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    5/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .

    .

    .

    -----------..

    odeCnstructionIymbolicSPurpose-llAeginnersBBASIC

    Gohn Kemeny and Thomas KurtzTime Sharing

    .

    MSBASICMicrosoft.Visual Basic)(

    !

    BASIC .

    )(VBBASIC .

    VB .Multimedia

    VB.. .

    VB)(

    .VB

    )(.. VBFrom scratch VC++: VC++

    Engines

    !2

    )(C# VB ++C VC++ .

    VBC# .... ||;++==++C

    ..:/-12PDF File:/-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    6/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    )) (:Visual BASIC(..

    ++. .

    ."Run++

    Time library"MSVBMnn.dll"".

    .dosbasic.

    ..

    ...

    Visual Basic 1

    .Windows.Visual Basic.

    Visual Basic 2

    Visual BasicIDE.Access 1.0

    Microsoft.

    Visual Basic 3

    Visual Basic!.OCXVBX

    1:wikipedia-

    http://ar.wikipedia.org/wiki/%D9%81%D9%8A%D8%AC%D9%88%D8%A7%D9%84_%D8%A8%D9%8A%D8%B

    3%D9%83 , Viewed 27/1/2009

    mailto:[email protected]://ar.wikipedia.org/wiki/%D9%81%D9%8A%D8%AC%D9%88%D8%A7%D9%84_%D8%A8%D9%8A%D8%Bhttp://ar.wikipedia.org/wiki/%D9%81%D9%8A%D8%AC%D9%88%D8%A7%D9%84_%D8%A8%D9%8A%D8%Bmailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    7/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .Visual BasicIDE.

    Visual Basic 4

    Windows 95

    !.BitVisualBasic.bit VisualBasicActiveX DLL

    OOPClassPolymorphismInheritance.

    Visual Basic 5

    .Visual Basic ActiveX ControlsActiveX Documents..

    EXEP-CodeNative-Code.

    .IDE

    Visual Basic 6

    Bugs.ADO.

    ..InternetWizards.FunctionsUDT

    .

    Visual Basic.NET

    Vb 2003vb2005vb 2008

    Visual Basic

    Visual BasicWindows..

    .

    Visual Basic

    BASIC..!Visual Basic

    COMActiveX ControlAdd-Ins.COM.

    .!

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    8/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Windows

    .Windows%Visual Basic.WindowsAPIVisual Basic

    MSVBVM60.DLL

    .Visual Basic

    Visual Basic.ActiveX Controls. ActiveX DocumentsInternet Explorer.

    Visual BasicClient.ASPApplicationsServerDHTML Applications

    Visual Basic

    Visual.WindowsVisual Basic

    Basic.!Visual Basic. Visual BasicCOM

    Visual Basic.NET!!.

    ..

    .

    Basic))Beginners All-PurposeSymbolic Instruction Code

    DosGW-BASICQuickBasic and QBasicQBASIC

    Visual Basic Tutorials.

    /com.arab4vb.www://http

    .VISUAL BASIC.NET

    1:wikipedia-

    http://ar.wikipedia.org/wiki/%D9%81%D9%8A%D8%AC%D9%88%D8%A7%D9%84_%D8%A8%D9%8A%D8%B

    3%D9%83 , Viewed 27/1/2009

    mailto:[email protected]://ar.wikipedia.org/wiki/%D9%81%D9%8A%D8%AC%D9%88%D8%A7%D9%84_%D8%A8%D9%8A%D8%Bhttp://ar.wikipedia.org/wiki/%D9%81%D9%8A%D8%AC%D9%88%D8%A7%D9%84_%D8%A8%D9%8A%D8%Bmailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    9/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    VB.Net ..:

    VBVS.Net

    .. ...

    ::..EnterIf X = 0 Then

    :EndIf

    Then !If

    .

    ..:.

    .. ..

    ..Splitter

    .

    Run Time.

    Compiler VS.Net

    VBVC++..RecursiveProgramming .

    ..TryException HandlersCatch.. End Try.

    VB.Net Object Oriented Programming ClassesArraysStringsIntegers

    ........ !

    InheritancePolymorphism .. Single Inheritance.ClassesNet Framework.

    API ... APIsDirectX)(

    Controls .

    : Stack Queue BitArrayArrayList.

    .//:-1http://www.montada.com/forumdisplay.php?f=212

    mailto:[email protected]://www.montada.com/forumdisplay.php?f=212http://www.montada.com/forumdisplay.php?f=212mailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    10/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    LoopsIf Statements.

    TypeNested Classes .

    .Interfaces

    Delegate !

    Attributes

    .

    .. FileSystemWatcherCollection.Serialization

    ..+GDI

    .....

    Pointers

    !System

    Threads Multithreading.

    ADO.Net

    .

    VB ASPServers

    !!ASP

    ).Net 2002(.Net).Net 2003(

    .Net#J++C#CStanderdProfessionalTeam Suite

    Express.VB.Net 2005Visual Basic .Net 2008.

    "":-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    11/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :VB.Net 2005

    .

    Windows XP Professional serves Pack 2 Windows XP Home Educat serves Pack 2 Windows server 2003 serves Pack 1 Windows server 2000 serves Pack 4 Windows Data center server

    ...)*( )*(.

    com.it4salem.www

    ........

    .

    E- MailWeb [email protected][email protected]@gmail.com

    www.salem4it.com

    - "":1

    mailto:[email protected]:[email protected]:[email protected]:[email protected]://www.salem4it.com/http://www.salem4it.com/mailto:[email protected]:[email protected]:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    12/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -.-.-.-.-.-.

    -.-.-.

    -.-.-.-.

    -ADO.Net.-.-SQLADO.Net.-Reports.-.-.-.

    -.-.-.-.-.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    13/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    14/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .Net

    .Net Framework

    .

    .

    .

    .Net .Net..

    Visual Studioof Microsoft .NET 2.0.NetVisual Basic 20052005

    .NET

    .NET Framework.. Net.NET.class libraries

    Framework.

    .

    Web

    Servieses .

    :

    .

    OOPVB# CJAVA.

    FrameworkXML

    .

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    15/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    IISASPASP.NET.APIATLMFCBaseClassDNACOM+ 2.0++ COOPVB

    OPEN SOURCE#CComponents

    SOAPXMLRegistryWeb Services

    .

    .NET :

    PDC(

    Next Generation Windows Services )IIS 4%VS7

    135..

    :1

    %.

    .

    .

    ..

    SoftwareService)(

    Simple Object Access ProtocolSoap.COMCOBRAHTTP

    .

    1com.itwadi.www//:-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    16/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .NET :

    .NET

    VBWindows, IIS ASP

    . SopaXMLWeb Services.Visual Studio.Net

    ) .(.JAVA

    .VirtualFramework#C

    Machine .)(

    .

    WindowsVista

    .

    %Framework 3.5 Framework 2.0%

    Framework.

    Windows-XP Windows 98.Windows Mil

    Framework 1.1Framework 2.0

    Framework 2.0Framework 3.5...Framework 3.5

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    17/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .Net Framework

    .Net Framework

    .Net Framework

    )(

    .Net Framework

    .Net Framework

    DesktopOOPVersioningRemoteDistributed

    .

    :

    1Visual Basic.NetPDF File.Net:/-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    18/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    3400.NetXML

    Common Language Runtime - CLR

    .Net Framework CLRCLR

    CLR#VB,C++,CCLR. CobolPerl ,Python

    CLR

    CLRMetadata

    CLRClasses-:

    ASP.NETASP.Net

    .

    Net

    ActiveX.NET

    .Ado.Net, Windows Frame

    +GDI.

    .:((Source Program.:((Object Program

    .:((Machine Language .:((Complier-:

    ......

    PDF File((Visual Basic.Net 2003:/-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    19/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    JIT

    .NET--.(JIT) - Just In Time Compiling

    (.)Optimization

    Class Library

    Class Library.Net Framework.NET

    NetIO.SystemIO.System

    IO.System.FileASP.NetASP.NetSystem.Web

    Assemblies

    AssembliesAssemblies.NetAssembliesMscorlib.dllSystem.IO

    Visual Basic.NetPDF File.Net:/-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    20/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    21/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    2005Net.Visual Basic

    Microsoft Visual Basic 2005 Express Edition

    :

    http://download.microsoft.com/download/D/9/C/D9C35F20-A749-4E25-A306-DE20B93AB8C0/VB.iso

    IDEvb.net 2005 integrated development environment, visual c# .net , visual j# .netvisual studio.netvisual basiv .net

    visual c++.net

    windows applicationvisual basic.net.

    mailto:[email protected]://download.microsoft.com/download/D/9/C/D9C35F20-A749-4E25-A306-DE20B93AB8C0/VB.isohttp://download.microsoft.com/download/D/9/C/D9C35F20-A749-4E25-A306-DE20B93AB8C0/VB.isomailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    22/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    23/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    24/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    25/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Integrated development environment - IDE

    VISUAL BASIC.NET

    VISUAL STUDIO.NET

    VISUAL C#.NETVISUAL J#.NET

    VISUAL C++.NET VISUAL BASIC.NET

    WINDOWS APPLICATIONWEB APPLICATIONCLASSES AND CONTROL LIBRARYCONSOLE APPLICATION

    ..

    Choose Default Environmant SettingsVISUAL STUDIO.NETVISUAL STUDIO.NET

    VISUAL BASICVISUAL STUDIO.NET

    Start Visual Studio

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    26/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    START PAGE

    FILENew Project

    New Project

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    27/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    "":

    :Class Library

    .

    .

    :Windows control library

    . VB.NET

    .. .

    .. .

    :indows serviceW

    Services NT....

    .

    ....

    :Console application

    DOS .

    :NET Web Application.ASP

    VS.NET...

    HTML.

    ASP.NET ..

    :NET Web Service.ASP

    Internet Servers

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    28/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .

    :

    )( ..XML

    .

    :Web Control library

    .

    :

    :""

    -Empty Project .

    -Empty Web Project .

    -New Project In Existing Folder .

    VS.NET..

    VS.NET

    .

    VISUAL BASIC.NETWINDOWS APPLICATIONVISUAL BASIC.NET

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    29/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    View

    Ctrl+Alt+XToolBox

    Form1

    PropertiesSolution Explorer

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    30/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    ( Solution(Project )(

    Project:

    Forms

    ClassesModules

    ))SolutionVb.Net Projects

    Solution

    SolutionProjectCtrl+Alt+LViewSolution Explorer

    Solution ExplorerNew ItemAdd

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    31/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Add New ItemNew Item

    VISUAL STDIO.NET

    Windows Form

    Add New Item

    AddFormFormSolution Explorer

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    32/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    MenuMenus With Visual Basic.Net 2005

    CustomizeTools

    Customize

    [File]

    1.""-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    33/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    34/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    [Edit]

    .text and other objects

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    35/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    [View]

    [Project]

    Explorer Solutions

    Appliction

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    36/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    37/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Compile

    1- Option Explicit

    2 - Option strict

    Dim i As IntegerDim s As Strings = "10"

    i = s ' This Fails.s = "Hello"i = s ' This Fails.

    Dim i As IntegerDim s As Strings = "10"i = s ' This works.

    s = "Hello"i = s ' This Fails.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    38/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Project and solutionoptionTools

    okVB Defaults

    Option compareBinary or Text

    Binary

    Resources

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    39/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    My.Resources.

    CarResources

    PictureBox

    PictureBox.Image = My.Resources.Car

    PublishSetup

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    40/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    [Bulid]

    Debug]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    41/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Window

    ,Breakpoint Watch

    Continue

    Stop Debugging

    Detach all

    Terminate all

    Restart

    Exceptions

    New Breakpoint

    [Data]

    Access ,Sql,Oracl

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    42/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    [Format]

    [Tools]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    43/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Attach To Process

    Attach

    Connect to Device

    Connect to Pocket PC or Smartphone devices or emulators

    Connect to Database

    Code Snippets Manager

    Insert Snippet

    Choose Toolbox Items

    ToolBox

    Macros

    ExternalTools

    Tools Menu

    Device Emulation Manager

    Import/ExportSettings

    IDE

    Customize Customize

    Options

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    44/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    [ Window ]

    Dockable, Floating, Tabbed Document

    Toolbox, Solution Explorer,

    Auto Hide

    Hide

    view

    Auto Hide All

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    45/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    New Horizontal Tab Group

    New Vertical Tab Group

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    46/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Close All Documents

    Reset Window Layout

    Windows

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    47/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    [Community]1

    MSDN Community Center

    aspx.497440aa/us-en/com.microsoft.2msdn://http

    [Help]

    1CHM FileVisual basic.Net 2005:/-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    48/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    :* Control

    Button , Textbox , LabelControl

    Component

    :Control

    OpenFileDialogmenu:*

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    49/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    ::*

    *

    Ctrl

    .Ctrl

    :

    TabControl, GroupBox, Panel,

    . .container

    containercontainercontainer

    . containercontainer .

    : Run Time*

    ToolBox

    Run Time .

    .

    ..

    : Run Time. Run Time

    Dim lblHi As New LabellblHi.SetBounds (50, 50, 70,70)lblHi.Text="Hello World"Me.Controls.Add (lblHi)

    LabellblHi. LabellblHi

    Hello WorldLabelText. SetBoundsAddlblHi.

    Label.Controls Button.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    50/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    WithEvents

    :

    Dim WithEvents btnHi As New Button

    ButtonbtnHi

    Class Name

    Method Name

    Dim WithEvents btnHi As Button

    btnHiClass Name

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    51/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    .

    WithEvents btnHi As ButtonButton

    Button1_Click

    btnHi = New ButtonbtnHi.SetBounds(96, 50, 75, 23)btnHi.Text = "Say Hi"Me.Controls.Add(btnHi)

    btnHiClick

    MessageBox.Show(Hi Man)

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    52/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Say HiButtonButton1Hi Man

    .

    :

    btnHiButtonButton

    Me.Controls.Remove(btnHi)btnHi = Nothing

    ButtonbtnHi.

    :

    TextBox.:TextName

    BackColorTextBox.

    ImagesImageList

    . TreeView

    :

    .F4Properties WindowsView

    .

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    53/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    .-:

    SizeX and YLocationfonts name, size, boldnessFontwidth and height

    (+).

    -:

    True and FalseVisible

    . False= 0True= -1-:

    ItemsListBoxImageListListBox

    TabControlImageListImages.. TabControl

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    54/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    : TabControlTabControl

    ImglstTabExpNameImageListTabExpNameImagesImglstTabExp

    AddOkTabExp

    ImglstTabExpTabExpImageList

    ((TabsTabExpTabPages

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    55/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    TabExp((TabsAddTabControl

    Tab

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    56/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    index

    .

    VB.NET 2005 .

    ?

    .:

    btnNumBUTTON

    -btnNum

    Text-TextboxtxtviewbtnNum.Click

    Dim MyButton As Button = DirectCast(sender, Button)txtview.Text = txtview.Text & MyButton.Text

    Anchor and Dock

    Anchor and DockAnchor

    Button , TextBox , listAnchorTop, Bottom, Left, Right

    Top, Left((pixel

    Notepad

    TextBox

    Anchor

    TextBox

    TrueMultiline

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    57/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    TextBoxAnchor

    TextBoxButton

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    58/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    NoneAnchor

    Top, RightButtonAnchor

    ButtonButtonTop, Right

    ButtonForm_Load

    Button1.Location = New Point(Me.ClientRectangle.Width -Button1.Width, Me.ClientRectangle.Height -Button1.Height)Button1.Anchor = AnchorStyles.Bottom Or AnchorStyles.Right

    TextBox

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    59/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    BottomNoneTopAnchor

    Dock

    TopDockLeft & RightButton

    ToolBarButtonAnchorTop, Left,

    RightDockTop, Bottom, Left, Right, Fill, or NoneFill

    NoneDockZ-orderstacking order.

    TrueMultiLineTextBox:

    :DockRight:

    Top:Bottom:Fill:

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    60/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    61/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    1

    1PDF File:/-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    62/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    63/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    64/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    1

    PDF File:/-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    65/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    66/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    67/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PDF File:/-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    68/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    69/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    70/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PDF File:/-12

    .(PDF File-(VB.Net 2005:/.-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    71/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    72/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -:

    .:

    .

    :

    -:.(integer, character, string)

    -:For

    Globel

    -:

    Private

    Public

    -

    .

    Dim

    Dim x As Integer

    static:

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    73/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    integer2,147,483,647

    .DoubleLong

    :

    longString

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    74/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Dim x&=5Dim y$="salem4it - Youssef"

    OptionExplicitOn

    Dim x=10000000000Dim y ="salem4it - Youssef"

    OptionsToolsOption ExplicitVB DefaultsProjects and Solutions

    OptionExplicitOffOptionExplicitOn

    Dim x=10000000000Dim y ="salem4it - Youssef"

    Stringylongx

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    75/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    X=100LY="A"c

    Charlong OptionExplicitOff&O&H

    i = 100 ' Decimal 100.i = &H64 ' Hexadecimal &H64 = 6 * 16 + 4 = 96 + 4 = 100.i = &O144 Octal &O144 = 1 * 8 * 8 + 4 * 8 + 4 =100.

    )(Rnd)(Randomize

    Visual Basic.Net 2005-:/.-1/

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    76/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    (PDF File+(VB.Net:/.-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    77/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    (PDF File+(VB.Net:/.-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    78/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    (PDF File+(VB.Net:/.-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    79/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    1

    (PDF File+(VB.Net:/.-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    80/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    81/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    82/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    83/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    1

    (PDF File+(VB.Net:/.-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    84/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    85/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    86/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    87/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    (PDF File+(VB.Net:/.-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    88/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    89/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    90/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    91/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    92/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    93/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    94/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    enums

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    95/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    structures

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    96/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    97/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    98/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Array1:

    Dim myvalue(5) AsInteger:

    Dim myvalue(5, 3) AsInteger

    :PublicClass Form1

    Dim myvalue(5) AsIntegerPrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    MyBase.Loadmyvalue(0) = 11myvalue(1) = 4myvalue(2) = 13myvalue(3) = 44

    myvalue(4) = 123EndSub

    EndClass

    :LoopPublicClass Form1

    Dim mycounter AsIntegerDim myvalue(5) AsIntegerPrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    MyBase.LoadFor mycounter = 0 To myvalue.Length - 1

    myvalue(mycounter) = mycounter

    NextEndSub

    EndClass

    Formycounterintegermyvalue.Length - 1Length.

    mycounter..

    PublicClass Form1Dim myvalue(5, 3) AsInteger

    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

    myvalue(0, 0) = 1myvalue(0, 1) = 2myvalue(0, 2) = 3myvalue(0, 3) = 4myvalue(1, 0) = 5myvalue(1, 1) = 6myvalue(1, 2) = 7myvalue(1, 3) = 8myvalue(2, 0) = 9myvalue(2, 1) = 10myvalue(2, 2) = 11

    myvalue(2, 3) = 12

    1.ArrayCHM File:/-

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    99/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    myvalue(3, 0) = 13myvalue(3, 1) = 14myvalue(3, 2) = 15myvalue(3, 3) = 16myvalue(4, 0) = 17myvalue(4, 1) = 18myvalue(4, 2) = 19

    myvalue(4, 3) = 20myvalue(5, 0) = 21myvalue(5, 1) = 22myvalue(5, 2) = 23myvalue(5, 3) = 24

    EndSub

    EndClass

    . :

    PublicClass Form1

    Dim myvalue(5) AsStringPrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

    myvalue(0) = "Visual"myvalue(1) = "Windows"myvalue(2) = "File"myvalue(3) = "Copy"myvalue(4) = "Edit"myvalue(5) = "Cut"

    EndSub

    EndClass.

    :Dim myvalue() AsString = {"Visual", "Windows", "File", "Copy"}

    :Dim myvalue(,) AsInteger = {{1, 2}, {3, 4}, {5, 6}}

    :RedimPublicClass Form1

    Dim myvalue(5) AsIntegerPrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    MyBase.Load

    ReDim myvalue(0)myvalue(0) = 1

    EndSub

    EndClass

    Form_loadRedim.

    .:

    PublicClass Form1

    Dim myvalue1(5) AsIntegerDim myvalue2(5, 5, 6) AsIntegerPrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    100/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    MyBase.LoadMsgBox(myvalue1.Rank)MsgBox(myvalue2.Rank)

    EndSub

    EndClass

    :PublicClass Form1

    Dim myvalue1(5) AsIntegerDim myvalue2(5, 5, 6) AsInteger

    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

    MsgBox(UBound(myvalue1))MsgBox((myvalue2.GetUpperBound(2)))

    EndSubEndClass

    .--

    ...:TextboxMsgbox

    PublicClass Form1Dim myvalue1(5) AsIntegerDim myvalue2(5, 5, 6) AsIntegerPrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

    MyBase.LoadTextBox1.Text = myvalue1(3)TextBox2.Text = myvalue2(3, 2, 5)

    EndSub

    EndClass

    .Textbox

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    101/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    102/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    2005

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    103/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    ""

    .

    .

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    104/220

  • 8/14/2019 + VB.Net 2005

    105/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    106/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    107/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Button2RefreshButton3StopButton4Back

    Button5Forward

    Go to URL

    :WebBrowser1.Navigate(ComboBox1.Text)

    Refresh

    :

    WebBrowser1.Refresh()

    Stop

    :

    WebBrowser1.Stop()

    Back

    :

    WebBrowser1.GoBack()

    Forward

    :

    WebBrowser1.GoForward()

    .PanelCombo box

    .Items)(

    Save web pageTextPanel

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    108/220

  • 8/14/2019 + VB.Net 2005

    109/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PDF--Adobe Acrobat

    )(

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    110/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    111/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    112/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    113/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    AxAcroPDF1.LoadFile("D:/arabsbook.pdf")

    AxAcroPDF1darabsbook.pdf

    f5

    save

    binexe

    C:\Documents and Settings\1\My Documents\Visual Studio2005\Projects\Project7\Project7\bin\Debug

    Project7

    msgbox ""

    msgbox ""

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    114/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    115/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    116/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    117/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :Dim clearDisplay As BooleanDim Operand1 As Double, Operand2 As Double Dim [Operator] As Stringpublic class

    :Private Sub bttn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handlesbttn0.Click, bttn1.Click, bttn2.Click, _bttn3.Click, bttn4.Click, bttn5.Click, bttn6.Click, bttn7.Click, bttn8.Click, bttn9.Click

    If clearDisplay ThenlblDisplay.Text = ""clearDisplay = FalseEnd IflblDisplay.Text = Val(lblDisplay.Text + sender.text)End Sub

    :

    Private Sub bttnPeriod_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles bttnPeriod.Click

    If lblDisplay.Text.IndexOf(".") > 0 ThenExit Sub

    ElselblDisplay.Text = lblDisplay.Text & "."End If

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    118/220

  • 8/14/2019 + VB.Net 2005

    119/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    (*)

    Private Sub bttnMultiply_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles bttnMultiply.Click

    Operand1 = Val(lblDisplay.Text)[Operator] = "*"clearDisplay = True

    End Sub_______________________

    (/)Private Sub bttnDivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles bttnDivide.Click

    Operand1 = Val(lblDisplay.Text)[Operator] = "/"

    clearDisplay = True

    End Sub_______________________

    form_ Form_load form_keypress

    Private Sub Form_KeyPress(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPressIf System.Char.IsDigit(e.KeyChar) Or e.KeyChar = "." ThenIf clearDisplay ThenlblDisplay.Text = ""clearDisplay = FalseEnd IflblDisplay.Text = lblDisplay.Text + e.KeyCharEnd IfEnd Sub_______________________

    lblDisplay.TextPrivate Sub bttnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesbttnClear.Click

    lblDisplay.Text = ""End Sub

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    120/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PublicClass Form1

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Button1.Click

    If RadioButton1.Checked = TrueThen

    a = 1

    Else

    a = 2

    EndIf

    Form2.Show()

    EndSub

    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) HandlesMyBase.Load

    RadioButton1.Checked = True

    Button1.Select()

    EndSub

    EndClass

    -://../-1./

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    121/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PublicClass Form2

    Dim hits AsInteger = 0

    PrivateSub Form2_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) HandlesMyBase.Load

    Me.Timer1.Enabled = False

    Me.Timer2.Enabled = False

    Me.Butpress.Enabled = False

    EndSub

    PrivateSub Butstart_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Butstart.Click

    SelectCase a

    Case 2

    Me.Timer1.Interval = 1000

    EndSelect

    Me.Timer1.Enabled = True

    Me.Timer2.Enabled = True

    Me.Butpress.Enabled = True

    Me.Butstart.Enabled = False

    EndSub

    PrivateSub Butpress_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Butpress.Click

    hits = hits + 1

    Me.lblhits.Text = Format(hits, "Number of hits = # ")

    EndSub

    PrivateSub Timer2_Tick(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Timer2.Tick

    Me.Timer1.Enabled = False

    Me.Timer2.Enabled = False

    Me.Butpress.Enabled = False

    Me.Butstart.Enabled = True

    EndSub

    PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Timer1.Tick

    Randomize()

    Me.Butpress.Left = 200 * Rnd()Me.Butpress.Top = 200 * Rnd()

    EndSub

    EndClass

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    122/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PublicClass Form1

    Dim a AsInteger

    Dim d AsLong

    PrivateSub Radiodays_CheckedChanged(ByVal sender As System.Object, ByVal e

    As System.EventArgs) Handles Radiodays.CheckedChanged

    a = 1

    EndSub

    PrivateSub Radiohours_CheckedChanged(ByVal sender As System.Object, ByVal e

    As System.EventArgs) Handles Radiohours.CheckedChanged

    a = 2

    EndSub

    PrivateSub Radiominutes_CheckedChanged(ByVal sender As System.Object, ByVal

    e As System.EventArgs) Handles Radiominutes.CheckedChanged

    a = 3

    EndSub

    PrivateSub Radioseconds_CheckedChanged(ByVal sender As System.Object, ByVal

    e As System.EventArgs) Handles Radioseconds.CheckedChanged

    a = 4

    EndSub

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Button1.Click

    SelectCase a

    Case 1

    d = DateDiff(DateInterval.Day, DateTimePicker1.Value, Now)

    ListBox1.Items.Add("the difference " & d & " Day")

    Case 2

    d = DateDiff(DateInterval.Hour, DateTimePicker1.Value, Now.Date)

    ListBox1.Items.Add("the difference " & d & " Hour")

    -://../-1./

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    123/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Case 3

    d = DateDiff(DateInterval.Minute, DateTimePicker1.Value,

    Now.Date)

    ListBox1.Items.Add("the difference " & d & " Minute")

    Case 4

    d = DateDiff(DateInterval.Second, DateTimePicker1.Value,

    Now.Date)

    ListBox1.Items.Add("the difference " & d & " Second")

    EndSelect

    EndSub

    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) HandlesMyBase.Load

    DateTimePicker1.ShowCheckBox = True

    Me.Text = "Date Calculater"

    Button1.Text = "Calculater"

    Radiodays.Checked = True

    Button1.Select()

    EndSub

    'Programming Mohamed Ahmed Youssef

    EndClass

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    124/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PublicClass Form1

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Button1.Click

    If RadioButton1.Checked = TrueThena = 1

    ElseIf RadioButton2.Checked = TrueThen

    a = 2

    Else

    a = 3

    EndIf

    Form2.Show()

    EndSub

    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) HandlesMyBase.Load

    Button1.Select()

    RadioButton1.Checked = TrueEndSub

    EndClass

    -://../-1./

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    125/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    PublicClass Form2

    Dim n1, n2 AsInteger

    Dim r1, r2 AsInteger

    PrivateSub Form2_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) HandlesMyBase.Load

    Button1.Select()

    TextBox3.Text = "Plase Enter the Result"SelectCase a

    Case 1

    Randomize()

    n1 = 1 + 10 * Rnd()

    n2 = 1 + 10 * Rnd()

    TextBox1.Text = "The Result of multiplication " + CStr(n1) + "

    by " + CStr(n2) + " = "

    TextBox2.Text = ""

    Case 2

    Randomize()

    n1 = 15 + 10 * Rnd()

    n2 = 15 + 10 * Rnd()

    TextBox1.Text = "The Result of multiplication " + CStr(n1) + "by " + CStr(n2) + " = "

    TextBox2.Text = ""

    Case 3

    Randomize()

    n1 = 100 + 10 * Rnd()

    n2 = 100 + 10 * Rnd()

    TextBox1.Text = "The Result of multiplication " + CStr(n1) + "

    by " + CStr(n2) + " = "

    TextBox2.Text = ""

    EndSelect

    EndSub

    PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button2.Click

    Button1.Select()

    TextBox3.Text = "Plase Enter the Result"

    SelectCase a

    Case 1

    Randomize()

    n1 = 1 + 10 * Rnd()

    n2 = 1 + 10 * Rnd()

    TextBox1.Text = "The Result of multiplication " + CStr(n1) + "

    by " + CStr(n2) + " = "

    TextBox2.Text = ""

    Case 2

    Randomize()n1 = 10 + 10 * Rnd()

    n2 = 10 + 10 * Rnd()

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    126/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    TextBox1.Text = "The Result of multiplication " + CStr(n1) + "

    by " + CStr(n2) + " = "

    TextBox2.Text = ""

    Case 3

    Randomize()

    n1 = 100 + 10 * Rnd()

    n2 = 100 + 10 * Rnd()

    TextBox1.Text = "The Result of multiplication " + CStr(n1) + "

    by " + CStr(n2) + " = "

    TextBox2.Text = ""

    EndSelect

    EndSub

    PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Button1.Click

    r1 = n1 * n2

    Try

    r2 = TextBox2.Text

    If r1 = r2 Then

    TextBox3.Text = "congratulation , True Result"

    Else

    TextBox3.Text = "Sorry ,Wronge Result the True Resulte " +CStr(r1) + " "

    EndIf

    Catch ex As Exception

    MsgBox("Enter the answer")

    ExitSub

    EndTry

    EndSub

    EndClass

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    127/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    C:\images""

    You have to copy contents of subdirectory images into C:\imagesPublicClass Form1

    ''w=Wrong Answer

    'r=Right Answer

    Dim r, w AsInteger

    ' Dim a AsString

    'Dim nameflage AsString

    PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) HandlesMyBase.Load

    'With ComboBox1

    .Items.Add("")

    .Items.Add(" ")

    .Items.Add("_")

    .Items.Add("")

    -://../-1./

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    128/220

  • 8/14/2019 + VB.Net 2005

    129/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    EndIf

    EndSub

    PrivateSub Button3_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles Button3.Click

    ' Call Flageshow()

    ComboBox1.Text = " "TextBox1.Text = "Choose the name of country which flag is shown above."

    EndSub

    ' Sub Flageshow()

    ' Dim n AsInteger

    ' Randomize()

    n = Rnd() * 26

    SelectCase n

    Case 1

    PictureBox1.Load("c:\images\ .png")nameflage = " "

    Case 2PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 3

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 4

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 5

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 6

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 7

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 8

    PictureBox1.Load("c:\images\ .png")nameflage = " "

    Case 9

    PictureBox1.Load("c:\images\ .png")nameflage = " "

    Case 10

    PictureBox1.Load("c:\images\_.png")

    nameflage = "_"Case 11

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 12

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 13

    PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 14

    PictureBox1.Load("c:\images\_.png")nameflage = "_"

    Case 15PictureBox1.Load("c:\images\.png")nameflage = ""

    Case 16

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    130/220

  • 8/14/2019 + VB.Net 2005

    131/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    132/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    SQL Server 2005

    SQL2005

    ..

    SQL-

    :-SQL2005

    SQL Server Management Studio Expresshttp://msdn.microsoft.com/en-us/express/bb410792.aspxhttp://go.microsoft.com/fwlink/?LinkId=65110

    SQL2005_Service_Managerhttp://moonfiles.com/in/upload/wh_18943946.zip

    -SQL2005-northwnd - PUB-.-Backup

    -View

    -Select Statment

    :SQL

    "Structured QueryLanguage"SQL

    SQL

    .

    :AccessSQL

    .Microsoft AccessSQLAccessSQL

    :Access

    :

    .

    )Forms(

    mailto:[email protected]://msdn.microsoft.com/en-us/express/bb410792.aspxhttp://go.microsoft.com/fwlink/?LinkId=65110http://moonfiles.com/in/upload/wh_18943946.ziphttp://moonfiles.com/in/upload/wh_18943946.ziphttp://go.microsoft.com/fwlink/?LinkId=65110http://msdn.microsoft.com/en-us/express/bb410792.aspxmailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    133/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    ::

    :.))MicroSoft JET:

    :SQL

    ::

    :TriggersStored Procedures

    Microsoft AccessSQL

    ::

    SQL service manager

    :

    : Windows Xp

    http://www.sqldbatips.com/samples/code/SQL2005SCM/SQL2005_Service_Manager.zip

    : Vista

    http://www.sqldbatips.com/samples/code/SQL2005SCM/SQL2005_Service_Manager_Vista.zip

    mailto:[email protected]://www.sqldbatips.com/samples/code/SQL2005SCM/SQL2005_Service_Manager.ziphttp://www.sqldbatips.com/samples/code/SQL2005SCM/SQL2005_Service_Manager_Vista.ziphttp://www.sqldbatips.com/samples/code/SQL2005SCM/SQL2005_Service_Manager_Vista.ziphttp://www.sqldbatips.com/samples/code/SQL2005SCM/SQL2005_Service_Manager.zipmailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    134/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    SQL Server Management Studio Express

    :

    http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8 -a0f62bf7796&displaylang=enhttp://msdn.microsoft.com/en-us/express/bb410792.aspx

    ( ( Start --- programs---- microsoft sql2005

    :

    Server Type

    mailto:[email protected]://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8http://msdn.microsoft.com/en-us/express/bb410792.aspxhttp://msdn.microsoft.com/en-us/express/bb410792.aspxhttp://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8mailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    135/220

  • 8/14/2019 + VB.Net 2005

    136/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    .- : Database Master.- : Database Model

    .- : Database Tempdb

    :.: : Security

    .:-Login.:-Server Role

    Managment: Server Object

    .: Backup .-: Linked Server ( ( Provider-: Maintenance Plans .-

    -:

    Emp_info: ID - Name - Address - Gender - Country - Birthday

    NewDatabasesDatabases

    Database Name OK:

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    137/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    138/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    New TablesTables

    ColumnName

    Data Type:

    Int -:.

    Bigint Int:9,223,372,036,854,775,807

    .

    Smallint : 32,768.

    Tinyint .-:

    Char :

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    139/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Nchar Unicode:

    Varchar :

    (Varchar(max .Varchar:

    Nvarchar UnicodeVarchar::

    (Nvarchar(max (Varchar(max:

    : ****

    ****: ****N Unicode

    Image Binary****:

    )(( Set Primary Key )

    Open Table

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    140/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    New Query:

    :

    ( ( From( ( Select::Emp_info:

    Select From .

    Execute

    .*Select * From Emp_info :

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    141/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    name - address - country- 2Select Name ,Adderss ,country From Emp_info

    -DISTINCT

    CountryCountry:

    Select DISTINCT Country From Emp_info

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    142/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -Where

    NameKhalid:

    :Select * From Emp_info

    Where Name = 'Khalid''' ' KhalidKhalid**

    Where

    =>=

  • 8/14/2019 + VB.Net 2005

    143/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -Order By

    Adderss::

    Select * from Emp_infoorder by Adderss

    :

    -AndOr

    : And-.: Or-

    : AndSelect * From Emp_info

    Where Adderss ='muscat'and Country='oman'

    OrSelect * From Emp_infoWhere Name ='salim'or Country='egypt'

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    144/220

  • 8/14/2019 + VB.Net 2005

    145/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    New DataBase DiagramsDataBase Diagrams

    IDEmpinfoID

    BackUpBackUp

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    146/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Backup

    MDFSQL

    ( ( Pub - NorthWind:

    http://rapidshare.com/files/120104132/SQL2000SampleDb.rar.html

    :

    ( ( C

    mailto:[email protected]://rapidshare.com/files/120104132/SQL2000SampleDb.rar.htmlhttp://rapidshare.com/files/120104132/SQL2000SampleDb.rar.htmlmailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    147/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    SQL2005-Database-attach

    -Add

    -( C )Northwind:

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    148/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    149/220

  • 8/14/2019 + VB.Net 2005

    150/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -

    -

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    151/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    :

    -

    -Database-

    -

    ((: To Database-

    From Device-

    -

    -Add

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    152/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -.

    -OK

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    153/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -

    Views

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    154/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    : Views

    Views ( Query )

    (.. )

    ( ( View : Customers : CompanyName -- ContactName : Orders

    : OrderDate : [Order Details]

    : UnitPrice --- Quantity --- Discount

    :View*

    Views

    NewView

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    155/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    ((

    F5

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    156/220

  • 8/14/2019 + VB.Net 2005

    157/220

  • 8/14/2019 + VB.Net 2005

    158/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Objects:APIConnection object--

    OleDb Data Provider)(API OleDb Data ProviderOleDb

    OleDbConnection. OdbcOdbcConnectionOdbc datasource

    SqlSqlConnectionSQL Serverdata base.

    OleDb!OleDb

    ADO.Net

    Disconnection

    Connection

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    159/220

  • 8/14/2019 + VB.Net 2005

    160/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    DataSetDataAdapter

    Microsoft AccessVB.Net 2003

    k_s_b

    . patient

    : view >> server explorer

    Visual Basic.NetPDF File.Net:/-1#C:b-s-k-2

    http://www.c4arab.com/showasection.php?lssid=108 , Viewed 12/10/2008

    mailto:[email protected]://www.c4arab.com/showasection.php?lssid=108http://www.c4arab.com/showasection.php?lssid=108mailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    161/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    Server explorer:

    , form ("Patient"), form.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    162/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    : DataSet

    form.

    :

    ,DataGrid Form,

    DataGrid Constructor......

    code:

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    163/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    DataSet"Patient".oleDbDataAdapterFill DataSet.

    DataGridDataGrid DataSet( ): SetDataBinding DataSet

    Exception"try , catch.handling " ...

    :

    .

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    164/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Reports

    ..

    :Solution Explorer

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    165/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    166/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    167/220

  • 8/14/2019 + VB.Net 2005

    168/220

  • 8/14/2019 + VB.Net 2005

    169/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Imports System.Data

    Imports System.Data.OleDb

    Public Class Form2

    Friend strConn2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath &

    "\InformationBank.mdb;User Id=admin;Password=;"

    Friend strSQL2 As String = "SELECT TheBank.id, TheBank.AskNumber, data.ask, data.answer

    FROM TheBank INNER JOIN data ON TheBank.ID = data.ID ORDER BY TheBank.AskNumber;"

    '"SELECT TheBank.id, TheBank.AskNumber, data.ask, data.answer FROM TheBank INNER JOIN data

    ON TheBank.ID = data.ID WHERE (((TheBank.ID)=18)) ORDER BY TheBank.AskNumber;" '"SELECT

    TheBank.id, TheBank.AskNumber, data.ask, data.answer FROM TheBank INNER JOIN data ON

    TheBank.ID = data.ID ORDER BY TheBank.AskNumber;"

    Friend cn2 As New OleDbConnection(strConn2)

    Friend daTheBankAndData2 As New OleDbDataAdapter(strSQL2, cn2)

    Friend MyDS2 As New DataSet

    Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Try

    cn2.Open()

    daTheBankAndData2.Fill(MyDS2, "TheBankAndData")

    cn2.Close()

    Dim rpt As New rptCrystalReport1

    '

    rpt.Load(Application.StartupPath & "\" & "rptCrystalReport1.rpt")

    rpt.SetDataSource(MyDS2.Tables("TheBankAndData"))

    '

    rpt.PrintOptions.PaperOrientation =

    CrystalDecisions.Shared.PaperOrientation.DefaultPaperOrientation

    ' 2

    CType(rpt.Section2.ReportObjects("Text1"),

    CrystalDecisions.CrystalReports.Engine.TextObject).Text = " "

    '

    '

    '

    rpt.RecordSelectionFormula = (" {TheBank.AskNumber} = " & Form1.txtnumber.Text & "")

    '

    CrystalReportViewer1.ReportSource = rpt

    CrystalReportViewer1.DisplayGroupTree = False

    CrystalReportViewer1.ShowGroupTreeButton = False

    CrystalReportViewer1.RightToLeft = Windows.Forms.RightToLeft.Yes

    '

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    170/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    '

    '

    CrystalReportViewer1.Zoom(1)

    CrystalReportViewer1.Refresh( )

    CrystalReportViewer1.Show( )

    Catch ex As Exception

    MessageBox.Show(ex.Message, " Show CrystalReport ... ", MessageBoxButtons.OK, _

    MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, _

    MessageBoxOptions.RtlReading)

    End Try

    End Sub

    End Class

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    171/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    172/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Help

    Microsoft Visual Basic Studio 2005Documentation)(.Net Framework

    ..

    :Visual Studio.

    () .-MSDN-MSDN Library

    MSDN)(NET Code Wise.NET Code Wise Community

    Community

    .

    .

    -How Do I ?.Microsoft Documents ExplorerHTML

    ( CommunityHelp)..

    ?.How Do I:.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    173/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -How Do I ?). (

    .-ToolsOptions.

    )(.

    -OnlineHelp. :.-

    NET(MSDN OnlineCode zone Community.

    Code Wise Community(Codezone.Search

    .-OK.

    .Option

    .

    Help2005Net.Visual Basic

    -)Help Favorites.(

    !.

    -Search.Search.

    "":-1

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    174/220

  • 8/14/2019 + VB.Net 2005

    175/220

  • 8/14/2019 + VB.Net 2005

    176/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Site LOGOSite NameDomain , Link Site

    www.cb4a.comwww.kutub.info/library/list.php?cat=1

    www.boosla.com

    www.star28.com

    www.university.arabsbook.com

    www.c4arab.com

    www.3asfh.net

    www.absba.infowww.absba.org

    ?http://edu.arabsgate.com/index.php

    www.bramjnet.com

    www.arabteam2000.com

    www.dvd4arab.com

    www.freelearn.110mb.com

    www.ask-pc.com

    www.vb4arab.com

    mailto:[email protected]://www.cb4a.com/http://www.kutub.info/library/list.php?cat=1http://www.boosla.com/http://www.star28.com/http://www.university.arabsbook.com/http://www.c4arab.com/http://www.3asfh.net/http://www.absba.info/http://www.absba.org/http://edu.arabsgate.com/index.phphttp://www.bramjnet.com/http://www.arabteam2000.com/http://www.dvd4arab.com/http://www.freelearn.110mb.com/http://www.ask-pc.com/http://www.vb4arab.com/http://www.vb4arab.com/http://www.ask-pc.com/http://www.freelearn.110mb.com/http://www.dvd4arab.com/http://www.arabteam2000.com/http://www.bramjnet.com/http://edu.arabsgate.com/index.phphttp://www.absba.org/http://www.absba.info/http://www.3asfh.net/http://www.c4arab.com/http://www.university.arabsbook.com/http://www.star28.com/http://www.boosla.com/http://www.kutub.info/library/list.php?cat=1http://www.cb4a.com/mailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    177/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Site LOGOSite NameDomain , Link Site

    www.geming-corp.com

    www.salem4it.com

    http://www.vc4arab.com/

    /"http://www.montada.com"

    www.itwadi.com

    http://www.krugle.org

    http://www.faressoft.com/

    http://mawsoaa.faressoft.com/

    http://saaid.net/book/list.php?cat=100

    1- www.msdn.microsoft.com/vbasic/2- www.devx.com/3- www.microsoft.com/learning/books/4- www.microsoft.com/learning/training/5- www.microsoft.com/communities/6- http://www.vbkeys.com/

    ..ADO.Net.ASP.Net.Visual Basic for Applications.

    "":-1

    -2

    mailto:[email protected]://www.geming-corp.com/http://www.salem4it.com/http://www.vc4arab.com/http://www.montada.com/http://www.itwadi.com/http://www.krugle.org/http://www.faressoft.com/http://mawsoaa.faressoft.com/http://saaid.net/book/list.php?cat=100http://www.msdn.microsoft.com/vbasic/http://www.devx.com/http://www.microsoft.com/learning/books/http://www.microsoft.com/learning/training/http://www.microsoft.com/communities/http://www.vbkeys.com/http://www.vbkeys.com/http://www.microsoft.com/communities/http://www.microsoft.com/learning/training/http://www.microsoft.com/learning/books/http://www.devx.com/http://www.msdn.microsoft.com/vbasic/http://saaid.net/book/list.php?cat=100http://mawsoaa.faressoft.com/http://www.faressoft.com/http://www.krugle.org/http://www.itwadi.com/http://www.montada.com/http://www.vc4arab.com/http://www.salem4it.com/http://www.geming-corp.com/mailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    178/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    1.:-

    http://mawsoaa.faressoft.com/ , Viewed 27/1/2009

    mailto:[email protected]://mawsoaa.faressoft.com/http://mawsoaa.faressoft.com/mailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    179/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    180/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    )(.

    http://mawsoaa.faressoft.com/Download.html

    .)(

    RapidShare....

    http://rs279.rapidshare.com/files/134582739/Mawsoaa.part1.rar

    http://rs77.rapidshare.com/files/134625878/Mawsoaa.part2.rar

    mailto:[email protected]://mawsoaa.faressoft.com/Download.htmlhttp://rs279.rapidshare.com/files/134582739/Mawsoaa.part1.rarhttp://rs77.rapidshare.com/files/134625878/Mawsoaa.part2.rarhttp://rs77.rapidshare.com/files/134625878/Mawsoaa.part2.rarhttp://rs279.rapidshare.com/files/134582739/Mawsoaa.part1.rarhttp://mawsoaa.faressoft.com/Download.htmlmailto:[email protected]
  • 8/14/2019 + VB.Net 2005

    181/220

  • 8/14/2019 + VB.Net 2005

    182/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    ::

    ::.SQL

    ::.VB.Net

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    183/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    -SQL.-SQL.-.-.-.

    -.-.-.-.

    -.-.

    -.-.

    -.-.-.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    184/220

  • 8/14/2019 + VB.Net 2005

    185/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    SQL

    :

    ADO.NET 2 ProgrammingVisual Basic.Net 2005 .

    :

    -:

    -SQL.-SQL.-.

    -. -.-.-.-.-.-.

    .SQL

    (OleDBADO.Net 2 Programming, SQLClient ):-

    SQL Server 2000 OR 2005 Oracle My SQL Ms Access 2000 OR 2003

    .SQL

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    186/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Content

    SQL

    DML

    Select

    Where

    Like

    Insert Into

    Update

    Delete

    SQL Function

    Order By

    or-and

    IN

    and..Between

    Alias

    Join

    and Union AllUnion

    SQL Function

    SQL Group By and Having

    DLL

    Create Database

    Create Table

    Create Index

    Drop

    Alter Table

    Select Into

    Create View

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    187/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :SQL

    SQL:Structured Query Language

    -:

    -ANSI-

    - ----

    :SQL

    ANSI (American National Standards Institute)Database System

    :SQL

    Ms-Access , Ms-SQL Server , DB2 , Oracle ,SQL Server 2000 OR 2005 , etc.

    :SQL

    -SQL Data Manipulation Language (DML)

    :

    -Select:

    -INSERT INTO: -Update:-Delete:

    2- Data Definition Language (DDL)

    :

    -Create Database:-Create Table:-Alter table:

    -Drop table: -Create index:-Drop index:

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    188/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    "" SQL Data Manipulation Language (DML)

    Select

    Syntax :

    SELECT column_name(s)FROM table_name

    SQL:SELECT = select

    :

    The database table "Persons":

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Svendson Tove Borgvn 23 Sandnes

    Pettersen Kari Storgt 20 Stavanger

    ((FirstName , LastName:

    SELECT LastName,FirstName FROM Persons

    :

    Result:

    LastName FirstName

    Hansen Ola

    Svendson Tove

    Pettersen Kari

    :

    SELECT * FROM Persons

    :

    Result:

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Svendson Tove Borgvn 23 Sandnes

    Pettersen Kari Storgt 20 Stavanger

    ): ; SQL(.

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    189/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    SELECTDISTINCTSELECT

    (DISTINCT.)

    DISTINCT:

    SELECT Company FROM Orders

    "Orders" table

    Company OrderNumber

    Sega 3412

    W3Schools 2312

    Trio 4678

    W3Schools 6798

    Result:

    Company

    Sega

    W3Schools

    Trio

    W3Schools

    DISTINCT

    SELECT DISTINCT Company FROM Orders

    Result:

    Company

    Sega

    W3Schools

    Trio

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    190/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    WHERE

    :Select

    Syntax

    SELECT column FROM table

    WHERE column operator value

    :Where

    =!SQL:

    Where

    SELECT * FROM PersonsWHERE City='Sandnes'

    "Persons" table

    LastName FirstName Address City Year

    Hansen Ola Timoteivn 10 Sandnes 1951

    Svendson Tove Borgvn 23 Sandnes 1978

    Svendson Stale Kaivn 18 Sandnes 1980

    Pettersen Kari Storgt 20 Stavanger 1960

    Result

    LastName FirstName Address City YearHansen Ola Timoteivn 10 Sandnes 1951

    Svendson Tove Borgvn 23 Sandnes 1978

    Svendson Stale Kaivn 18 Sandnes 1980

    ): ' (.

    :

    For text values:

    This is correct:SELECT * FROM Persons WHERE FirstName='Tove'This is wrong:

    =

    > =

  • 8/14/2019 + VB.Net 2005

    191/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    SELECT * FROM Persons WHERE FirstName=Tove

    For numeric values:

    This is correct: SELECT * FROM Persons WHERE Year>1965

    This is wrong: 'SELECT * FROM Persons WHERE Year>'1965

    Like

    .

    Syntax

    SELECT column FROM tableWHERE column LIKE pattern

    :( % )

    A

    SELECT * FROM PersonsWHERE FirstName LIKE 'a%'

    A

    SELECT * FROM PersonsWHERE FirstName LIKE '%a'

    A

    SELECT * FROM PersonsWHERE FirstName LIKE '%a%'

    Between.

    -:INSERT INTO-:UPDATE-:DELETE

    :INTOINSERT

    :

    Syntax

    INSERT INTO table_name

    VALUES (value1, value2,....):

    INSERT INTO table_name (column1, column2,...)

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    192/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    VALUES (value1, value2,....)

    :

    This "Persons" table:

    LastName FirstName Address City

    Pettersen Kari Storgt 20 Stavanger

    INSERT INTO PersonsVALUES ('Hetland', 'Camilla', 'Hagabakka 24', 'Sandnes')

    :

    LastName FirstName Address City

    Pettersen Kari Storgt 20 Stavanger

    Hetland Camilla Hagabakka 24 Sandnes

    :)(

    INSERT INTO Persons (LastName, Address)VALUES ('Rasmussen', 'Storgt 67')

    :

    LastName FirstName Address City

    Pettersen Kari Storgt 20 Stavanger

    Hetland Camilla Hagabakka 24 Sandnes

    Rasmussen Storgt 67

    :UPDATE

    :

    Syntax

    UPDATE table_nameSET column_name = new_value

    WHERE column_name = some_value

    :

    Person:

    LastName FirstName Address City

    Nilsen Fred Kirkegt 56 Stavanger

    Rasmussen Storgt 67

    :

    UPDATE Person SET FirstName = 'Nina'WHERE LastName = 'Rasmussen'

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    193/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Result:

    LastName FirstName Address City

    Nilsen Fred Kirkegt 56 Stavanger

    Rasmussen Nina Storgt 67

    :

    UPDATE PersonSET Address = 'Stien 12', City = 'Stavanger'WHERE LastName = 'Rasmussen'

    Result:

    LastName FirstName Address City

    Nilsen Fred Kirkegt 56 StavangerRasmussen Nina Stien 12 Stavanger

    :DELETE

    :

    Syntax

    DELETE FROM table_nameWHERE column_name = some_value

    :

    Person:

    LastName FirstName Address City

    Nilsen Fred Kirkegt 56 Stavanger

    Rasmussen Nina Stien 12 Stavanger

    DELETE FROM Person WHERE LastName = 'Rasmussen'

    Result :

    LastName FirstName Address City

    Nilsen Fred Kirkegt 56 Stavanger

    )(

    :

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    194/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    DELETE FROM table_nameorDELETE * FROM table_name

    FUNCTIONSQLSQL

    :Order By

    :

    Orders:

    Company OrderNumber

    Sega 3412

    ABC Shop 5678

    W3Schools 2312

    W3Schools 6798

    :

    SELECT Company, OrderNumber FROM OrdersORDER BY Company

    Result:

    Company OrderNumber

    ABC Shop 5678

    Sega 3412

    W3Schools 6798

    W3Schools 2312

    Company

    :

    SELECT Company, OrderNumber FROM OrdersORDER BY Company, OrderNumber

    Result:

    Company OrderNumber

    ABC Shop 5678

    Sega 3412

    W3Schools 2312

    W3Schools 6798

    :

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    195/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    SELECT Company, OrderNumber FROM OrdersORDER BY Company DESC

    Result:

    Company OrderNumber

    W3Schools 6798W3Schools 2312

    Sega 3412

    ABC Shop 5678

    :

    :

    SELECT Company, OrderNumber FROM OrdersORDER BY Company DESC, OrderNumber ASC

    :SELECT Company, OrderNumber FROM OrdersORDER BY OrderNumber , Company DESC

    Result:

    Company OrderNumber

    W3Schools 2312

    W3Schools 6798

    Sega 3412

    ABC Shop 5678

    ORAnd -:

    AND-OR-

    :

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Svendson Tove Borgvn 23 Sandnes

    Svendson Stephen Kaivn 18 Sandnes

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    196/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :ANDSELECT * FROM PersonsWHERE FirstName='Tove'AND LastName='Svendson'

    Result:

    LastName FirstName Address City

    Svendson Tove Borgvn 23 Sandnes

    :ORSELECT * FROM PersonsWHERE firstname='Tove'OR lastname='Svendson'

    Result: LastName FirstName Address City

    Svendson Tove Borgvn 23 Sandnes

    Svendson Stephen Kaivn 18 Sandnes

    :SELECT * FROM Persons WHERE(FirstName='Tove' OR FirstName='Stephen')AND LastName='Svendson'

    Result:

    LastName FirstName Address City

    Svendson Tove Borgvn 23 Sandnes

    Svendson Stephen Kaivn 18 Sandnes

    IN

    :SELECT column_name FROM table_nameWHERE column_name IN (value1,value2,..)

    :

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Nordmann Anna Neset 18 Sandnes

    Pettersen Kari Storgt 20 Stavanger

    Svendson Tove Borgvn 23 Sandnes

    SELECT * FROM PersonsWHERE LastName IN ('Hansen','Pettersen')

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    197/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Result:

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Pettersen Kari Storgt 20 Stavanger

    SELECT * FROM table1_nameWHERE FirstName in (SELECT * FROM table2_name)

    Table1_nameFirstName

    table2_name

    AND...BETWEEN

    :SELECT column_name FROM table_nameWHERE column_nameBETWEEN value1 AND value2

    :

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Nordmann Anna Neset 18 Sandnes

    Pettersen Kari Storgt 20 Stavanger

    Svendson Tove Borgvn 23 Sandnes

    SELECT * FROM Persons WHERE LastNameBETWEEN 'Hansen' AND 'Pettersen'

    Result:

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Nordmann Anna Neset 18 Sandnes

    SELECT * FROM Persons WHERE LastNameNOT BETWEEN 'Hansen' AND 'Pettersen'

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    198/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Result:

    LastName FirstName Address City

    Pettersen Kari Storgt 20 Stavanger

    Svendson Tove Borgvn 23 Sandnes

    .)#()'(

    Alias

    AS

    :SELECT column AS column_alias FROM table

    :

    SELECT column AS column_alias FROM table

    :

    This table (Persons):

    LastName FirstName Address City

    Hansen Ola Timoteivn 10 Sandnes

    Svendson Tove Borgvn 23 Sandnes

    Pettersen Kari Storgt 20 Stavanger

    SELECT LastName AS Family, FirstName AS NameFROM Persons

    Result:

    )(

    Family Name

    Hansen Ola

    Svendson TovePettersen Kari

    SELECT LastName, FirstNameFROM Persons AS Employees

    Result:

    Table Employees:

    LastName FirstName

    Hansen OlaSvendson Tove

    Pettersen Kari

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    199/220

  • 8/14/2019 + VB.Net 2005

    200/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Result:

    Name

    Hansen, Ola

    :JOININNER

    :SELECT field1, field2, field3FROM first_tableINNER JOIN second_tableON first_table.keyfield = second_table.foreign_keyfield

    :SELECT Employees.Name, Orders.ProductFROM EmployeesINNER JOIN OrdersON Employees.Employee_ID=Orders.Employee_ID

    Result:

    Name Product

    Hansen, Ola Printer

    Svendson, Stephen Table

    Svendson, Stephen Chair

    INNER JOIN

    :LEFT JOIN

    :SELECT field1, field2, field3FROM first_tableLEFT JOIN second_tableON first_table.keyfield = second_table.foreign_keyfield

    :SELECT Employees.Name, Orders.ProductFROM EmployeesLEFT JOIN OrdersON Employees.Employee_ID=Orders.Employee_ID

    Result:

    Name Product

    Hansen, Ola Printer

    Svendson, Tove

    Svendson, Stephen Table

    Svendson, Stephen Chair

    Pettersen, Kari

    LEFT JOINEmployee

    :RIGHT JOIN

    :

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    201/220

  • 8/14/2019 + VB.Net 2005

    202/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    UNION ALLandUNION

    .

    :SQL Statement 1UNIONSQL Statement 2

    :

    Employees_Norway:

    E_ID E_Name

    01 Hansen, Ola

    02 Svendson, Tove

    03 Svendson, Stephen04 Pettersen, Kari

    Employees_USA:

    E_ID E_Name

    01 Turner, Sally

    02 Kent, Clark

    03 Svendson, Stephen

    04 Scott, Stephen

    :E_NAME

    SELECT E_Name FROM Employees_NorwayUNIONSELECT E_Name FROM Employees_USA

    Result:

    E_Name

    Hansen, Ola

    Svendson, Tove

    Svendson, StephenPettersen, Kari

    Turner, Sally

    Kent, Clark

    Scott, Stephen

    .:UNION ALL

    .UNION

    :

    SQL Statement 1UNION ALLSQL Statement 2

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    203/220

  • 8/14/2019 + VB.Net 2005

    204/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :

    SELECT AVG(Column) From Table

    SELECT COUNT(column) From Table

    SELECT COUNT(*) From Table

    SELECT First(column) From Table

    SELECT last(column) From Table

    SELECT Max(column) From Table

    SELECT Min(column) From Table

    SELECT SUM(column) From Table

    SELECT COUNT(DISTINCT column) From Table

    SQLGROUP BY and HAVING

    GROUP BYSUM

    :SELECT column,SUM(column) FROM table GROUP BY column

    :

    Company Amount

    W3Schools 5500

    IBM 4500

    W3Schools 7100

    :

    SELECT Company, SUM(Amount) FROM Sales

    Returns this result:

    Company SUM(Amount)

    W3Schools 17100

    IBM 17100

    W3Schools 17100

    .:GROUP BY

    SELECT Company,SUM(Amount) FROM SalesGROUP BY Company

    Returns this result:

    Company SUM(Amount)

    W3Schools 12600

    IBM 4500

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    205/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    HAVING:

    SELECT column,SUM(column) FROM tableGROUP BY columnHAVING SUM(column) condition value

    :

    Company Amount

    W3Schools 5500

    IBM 4500

    W3Schools 7100

    :

    SELECT Company,SUM(Amount) FROM SalesGROUP BY CompanyHAVING SUM(Amount)>10000

    Returns this result :

    Company SUM(Amount)

    W3Schools 12600

    .

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    206/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    "" )DDL(Data Definition Language

    Data Definition Language (DDL)

    :

    -Create Database:-Create Table:-ALTER TABLE:-DROP TABLE:-CREATE INDEX:)(-DROP INDEX:

    :Create Database

    CREATE DATABASE database_name

    .

    :Create Table:

    CREATE TABLE table_name(column_name1 data_type,column_name2 data_type,.......)

    :

    CREATE TABLE Person(LastName text(30),FirstName text(30),Address text(150),Age (Number))

    .

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    207/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    :CREATE INDEX

    .

    .\

    Unique Index)(

    CREATE UNIQUE INDEX index_nameON table_name (column_name)

    Simple Index

    CREATE INDEX index_nameON table_name (column_name)

    :

    CREATE INDEX PersonIndexON Person (LastName)

    :

    CREATE INDEX PersonIndexON Person (LastName DESC)

    :

    CREATE INDEX PersonIndexON Person (LastName, FirstName)

    Drop

    Drop)(

    :-:

    DROP DATABASE database_name

    ::-:

    DROP TABLE table_name

    :-::

    Syntax for Microsoft SQLJet (and Microsoft Access):

    DROP INDEX index_name ON table_name

    mailto:[email protected]:[email protected]
  • 8/14/2019 + VB.Net 2005

    208/220

    PPrroogg:: Mohamed Youssef EE__MMaaiill::[email protected]

    Syntax for MS SQL Server:

    DROP INDEX table_name.index_name

    Syntax for IBM DB2 and Oracle:

    DROP INDEX index_name

    Syntax for MySQL:

    ALTER TABLE table_name DROP INDEX index_name

    :

    TRUNCATE TABLE table_name

    ALTER TABLE) .(

    :

    ALTER TABLE table_nameADD column_name datatype

    ::

    ALTER TABLE tab