I need help with System Analysis and Design
Chap26/Area Solution/Area Project/App.config
Chap26/Area Solution/Area Project/Area Project.vbproj
Debug AnyCPU {9F9C12A2-4584-4564-82ED-5353E139F8B3} WinExe Area_Project.My.MyApplication Area_Project Area Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Area Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Area Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Area Solution/Area Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Public Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtSide = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.lblArea = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(123, 25) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(135, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Side measurement:" ' 'txtSide ' Me.txtSide.Location = New System.Drawing.Point(126, 48) Me.txtSide.Margin = New System.Windows.Forms.Padding(2) Me.txtSide.Name = "txtSide" Me.txtSide.Size = New System.Drawing.Size(53, 27) Me.txtSide.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(284, 25) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(43, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Area:" ' 'lblArea ' Me.lblArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblArea.Location = New System.Drawing.Point(288, 48) Me.lblArea.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblArea.Name = "lblArea" Me.lblArea.Size = New System.Drawing.Size(93, 29) Me.lblArea.TabIndex = 5 Me.lblArea.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(126, 97) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(117, 38) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate Area" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(265, 97) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(117, 38) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Area_Project.My.Resources.Resources.Square Me.PictureBox1.Location = New System.Drawing.Point(18, 12) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(90, 90) Me.PictureBox1.TabIndex = 6 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(406, 168) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblArea) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtSide) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.MaximizeBox = False Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Area Calculator -Square " CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtSide As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblArea As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class
Chap26/Area Solution/Area Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True
Chap26/Area Solution/Area Project/frmMain.vb
' Name: Area Project ' Purpose: Display the area of a square ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub txtSide_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtSide.KeyPress ' allows the user to accept only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtSide_TextChanged(sender As Object, e As EventArgs) Handles txtSide.TextChanged lblArea.Text = String.Empty End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the area of a square ' instantiate a Square object ' declare a variable to store the area ' assign input to the Square object's property ' use the Square object's method to calculate the area ' display the area with two decimal places txtSide.Focus() End Sub End Class
Chap26/Area Solution/Area Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Area_Project.frmMain End Sub End Class End Namespace
Chap26/Area Solution/Area Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Area Solution/Area Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Area Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Area Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("5913a98c-e0c1-4a15-9391-cfb15990aa66")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Area Solution/Area Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Area_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Square() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Square", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Area Solution/Area Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Square.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Area Solution/Area Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Area_Project.My.MySettings Get Return Global.Area_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Area Solution/Area Project/My Project/Settings.settings
Chap26/Area Solution/Area Project/Resources/Square.png
Chap26/Area Solution/Area Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Area Project", "Area Project\Area Project.vbproj", "{9F9C12A2-4584-4564-82ED-5353E139F8B3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9F9C12A2-4584-4564-82ED-5353E139F8B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9F9C12A2-4584-4564-82ED-5353E139F8B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {9F9C12A2-4584-4564-82ED-5353E139F8B3}.Release|Any CPU.ActiveCfg = Release|Any CPU {9F9C12A2-4584-4564-82ED-5353E139F8B3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Bonnette Solution/Bonnette Project/App.config
Chap26/Bonnette Solution/Bonnette Project/Bonnette Project.vbproj
Debug AnyCPU {DE7092C4-2827-4D93-A9B1-79F51A851693} WinExe Bonnette_Project.My.MyApplication Bonnette_Project Bonnette Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Bonnette Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Bonnette Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Bonnette Solution/Bonnette Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Public Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.txtLength = New System.Windows.Forms.TextBox() Me.txtWidth = New System.Windows.Forms.TextBox() Me.txtDepth = New System.Windows.Forms.TextBox() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.Label4 = New System.Windows.Forms.Label() Me.lblGallons = New System.Windows.Forms.Label() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(130, 36) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(50, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Length:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(130, 75) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(45, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Width:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(130, 112) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(46, 17) Me.Label3.TabIndex = 4 Me.Label3.Text = "&Depth:" ' 'txtLength ' Me.txtLength.Location = New System.Drawing.Point(182, 36) Me.txtLength.Margin = New System.Windows.Forms.Padding(2) Me.txtLength.Name = "txtLength" Me.txtLength.Size = New System.Drawing.Size(62, 25) Me.txtLength.TabIndex = 1 ' 'txtWidth ' Me.txtWidth.Location = New System.Drawing.Point(182, 75) Me.txtWidth.Margin = New System.Windows.Forms.Padding(2) Me.txtWidth.Name = "txtWidth" Me.txtWidth.Size = New System.Drawing.Size(62, 25) Me.txtWidth.TabIndex = 3 ' 'txtDepth ' Me.txtDepth.Location = New System.Drawing.Point(182, 112) Me.txtDepth.Margin = New System.Windows.Forms.Padding(2) Me.txtDepth.Name = "txtDepth" Me.txtDepth.Size = New System.Drawing.Size(62, 25) Me.txtDepth.TabIndex = 5 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(260, 36) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(83, 29) Me.btnCalc.TabIndex = 6 Me.btnCalc.Text = "&Calculate" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(260, 75) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(83, 29) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(130, 169) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(54, 17) Me.Label4.TabIndex = 8 Me.Label4.Text = "Gallons:" ' 'lblGallons ' Me.lblGallons.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer)) Me.lblGallons.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblGallons.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblGallons.Location = New System.Drawing.Point(183, 165) Me.lblGallons.Name = "lblGallons" Me.lblGallons.Size = New System.Drawing.Size(160, 30) Me.lblGallons.TabIndex = 9 Me.lblGallons.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Bonnette_Project.My.Resources.Resources.SwimmingPool Me.PictureBox1.Location = New System.Drawing.Point(12, 36) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(97, 150) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 10 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AcceptButton = Me.btnCalc Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(366, 216) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.lblGallons) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtDepth) Me.Controls.Add(Me.txtWidth) Me.Controls.Add(Me.txtLength) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Bonnette Pool & Spa Depot" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents txtLength As System.Windows.Forms.TextBox Friend WithEvents txtWidth As System.Windows.Forms.TextBox Friend WithEvents txtDepth As System.Windows.Forms.TextBox Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents lblGallons As System.Windows.Forms.Label Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class
Chap26/Bonnette Solution/Bonnette Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True
Chap26/Bonnette Solution/Bonnette Project/frmMain.vb
' Name: Bonnette Project ' Purpose: Display the number of gallons ' needed to fill a rectangular pool ' Programmer: <your name> on <current date> Public Class frmMain Structure Dimensions Public dblLength As Double Public dblWidth As Double Public dblDepth As Double End Structure Public Function GetGallons(ByVal pool As Dimensions) As Double ' calculates and returns the number of gallons Const dblGAL_PER_CUBIC_FOOT As Double = 7.48 Return pool.dblLength * pool.dblWidth * pool.dblDepth * dblGAL_PER_CUBIC_FOOT End Function Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' displays the number of gallons Dim poolSize As Dimensions Dim dblGallons As Double Double.TryParse(txtLength.Text, poolSize.dblLength) Double.TryParse(txtWidth.Text, poolSize.dblWidth) Double.TryParse(txtDepth.Text, poolSize.dblDepth) dblGallons = GetGallons(poolSize) lblGallons.Text = dblGallons.ToString("N0") End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub txtLength_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtLength.KeyPress ' allow only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtWidth_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtWidth.KeyPress ' allow only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtDepth_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtDepth.KeyPress ' allow only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtLength_TextChanged(sender As Object, e As EventArgs) Handles txtLength.TextChanged lblGallons.Text = String.Empty End Sub Private Sub txtWidth_TextChanged(sender As Object, e As EventArgs) Handles txtWidth.TextChanged lblGallons.Text = String.Empty End Sub Private Sub txtDepth_TextChanged(sender As Object, e As EventArgs) Handles txtDepth.TextChanged lblGallons.Text = String.Empty End Sub End Class
Chap26/Bonnette Solution/Bonnette Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Bonnette_Project.frmMain End Sub End Class End Namespace
Chap26/Bonnette Solution/Bonnette Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Bonnette Solution/Bonnette Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Bonnette Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Bonnette Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("80f1e696-0ebc-407f-b693-25be3a564b4b")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Bonnette Solution/Bonnette Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Bonnette_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property SwimmingPool() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("SwimmingPool", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Bonnette Solution/Bonnette Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\SwimmingPool.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Bonnette Solution/Bonnette Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Bonnette_Project.My.MySettings Get Return Global.Bonnette_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Bonnette Solution/Bonnette Project/My Project/Settings.settings
Chap26/Bonnette Solution/Bonnette Project/Resources/SwimmingPool.png
Chap26/Bonnette Solution/Bonnette Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Bonnette Project", "Bonnette Project\Bonnette Project.vbproj", "{DE7092C4-2827-4D93-A9B1-79F51A851693}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {DE7092C4-2827-4D93-A9B1-79F51A851693}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DE7092C4-2827-4D93-A9B1-79F51A851693}.Debug|Any CPU.Build.0 = Debug|Any CPU {DE7092C4-2827-4D93-A9B1-79F51A851693}.Release|Any CPU.ActiveCfg = Release|Any CPU {DE7092C4-2827-4D93-A9B1-79F51A851693}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Carpet Haven Solution/Carpet Haven Project/App.config
Chap26/Carpet Haven Solution/Carpet Haven Project/Carpet Haven Project.vbproj
Debug AnyCPU {6E0C584D-D0EC-40AB-9662-CA0218C5F518} WinExe Carpet_Haven_Project.My.MyApplication Carpet_Haven_Project Carpet Haven Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Carpet Haven Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Carpet Haven Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Carpet Haven Solution/Carpet Haven Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.lblSquareYards = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.lblCost = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.txtLength = New System.Windows.Forms.TextBox() Me.txtWidth = New System.Windows.Forms.TextBox() Me.txtPrice = New System.Windows.Forms.TextBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(125, 26) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(84, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Length (feet):" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(230, 26) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(79, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Width (feet):" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(328, 26) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(145, 17) Me.Label3.TabIndex = 4 Me.Label3.Text = "&Price (per square yard):" ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(67, 141) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(88, 17) Me.Label4.TabIndex = 8 Me.Label4.Text = "Square yards:" ' 'lblSquareYards ' Me.lblSquareYards.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblSquareYards.Location = New System.Drawing.Point(67, 161) Me.lblSquareYards.Name = "lblSquareYards" Me.lblSquareYards.Size = New System.Drawing.Size(93, 28) Me.lblSquareYards.TabIndex = 9 Me.lblSquareYards.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(172, 141) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(37, 17) Me.Label5.TabIndex = 10 Me.Label5.Text = "Cost:" ' 'lblCost ' Me.lblCost.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblCost.Location = New System.Drawing.Point(172, 161) Me.lblCost.Name = "lblCost" Me.lblCost.Size = New System.Drawing.Size(93, 28) Me.lblCost.TabIndex = 11 Me.lblCost.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(270, 157) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(73, 32) Me.btnCalc.TabIndex = 6 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(349, 157) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(73, 32) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Carpet_Haven_Project.My.Resources.Resources.Carpet Me.PictureBox1.Location = New System.Drawing.Point(13, 26) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(100, 50) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 12 Me.PictureBox1.TabStop = False ' 'txtLength ' Me.txtLength.Location = New System.Drawing.Point(128, 47) Me.txtLength.Name = "txtLength" Me.txtLength.Size = New System.Drawing.Size(56, 25) Me.txtLength.TabIndex = 1 ' 'txtWidth ' Me.txtWidth.Location = New System.Drawing.Point(233, 47) Me.txtWidth.Name = "txtWidth" Me.txtWidth.Size = New System.Drawing.Size(56, 25) Me.txtWidth.TabIndex = 3 ' 'txtPrice ' Me.txtPrice.Location = New System.Drawing.Point(331, 47) Me.txtPrice.Name = "txtPrice" Me.txtPrice.Size = New System.Drawing.Size(56, 25) Me.txtPrice.TabIndex = 5 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(485, 221) Me.Controls.Add(Me.txtPrice) Me.Controls.Add(Me.txtWidth) Me.Controls.Add(Me.txtLength) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblCost) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.lblSquareYards) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Carpet Haven" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents lblSquareYards As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents lblCost As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents txtLength As System.Windows.Forms.TextBox Friend WithEvents txtWidth As System.Windows.Forms.TextBox Friend WithEvents txtPrice As System.Windows.Forms.TextBox End Class
Chap26/Carpet Haven Solution/Carpet Haven Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True True
Chap26/Carpet Haven Solution/Carpet Haven Project/frmMain.vb
' Name: Carpet Haven Project ' Purpose: Displays the number of square yards of ' carpet and the cost of the carpet ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub txtLength_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtLength.KeyPress ' accepts only numbers, the period, and the Backspace If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtWidth_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtWidth.KeyPress ' accepts only numbers, the period, and the Backspace If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtPrice_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtPrice.KeyPress ' accepts only numbers, the period, and the Backspace If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtLength_TextChanged(sender As Object, e As EventArgs) Handles txtLength.TextChanged lblCost.Text = String.Empty lblSquareYards.Text = String.Empty End Sub Private Sub txtWidth_TextChanged(sender As Object, e As EventArgs) Handles txtWidth.TextChanged lblCost.Text = String.Empty lblSquareYards.Text = String.Empty End Sub Private Sub txtPrice_TextChanged(sender As Object, e As EventArgs) Handles txtPrice.TextChanged lblCost.Text = String.Empty lblSquareYards.Text = String.Empty End Sub End Class
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Carpet_Haven_Project.frmMain End Sub End Class End Namespace
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Carpet Haven Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Carpet Haven Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("0f13d204-2125-40dd-9791-4269985f2bed")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Carpet_Haven_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Carpet() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Carpet", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Carpet.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Carpet_Haven_Project.My.MySettings Get Return Global.Carpet_Haven_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Carpet Haven Solution/Carpet Haven Project/My Project/Settings.settings
Chap26/Carpet Haven Solution/Carpet Haven Project/Resources/Carpet.png
Chap26/Carpet Haven Solution/Carpet Haven Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Carpet Haven Project", "Carpet Haven Project\Carpet Haven Project.vbproj", "{6E0C584D-D0EC-40AB-9662-CA0218C5F518}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {6E0C584D-D0EC-40AB-9662-CA0218C5F518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6E0C584D-D0EC-40AB-9662-CA0218C5F518}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E0C584D-D0EC-40AB-9662-CA0218C5F518}.Release|Any CPU.ActiveCfg = Release|Any CPU {6E0C584D-D0EC-40AB-9662-CA0218C5F518}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Circle Area Solution/Circle Area Project/App.config
Chap26/Circle Area Solution/Circle Area Project/Circle Area Project.vbproj
Debug AnyCPU {2ADF401D-88F8-4250-8EE4-78B9A98DB30E} WinExe Circle_Area_Project.My.MyApplication Circle_Area_Project Circle Area Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Circle Area Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Circle Area Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Circle Area Solution/Circle Area Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.PictureBox1 = New System.Windows.Forms.PictureBox() Me.Label1 = New System.Windows.Forms.Label() Me.txtRadius = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.lblArea = New System.Windows.Forms.Label() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Circle_Area_Project.My.Resources.Resources.Circle Me.PictureBox1.Location = New System.Drawing.Point(15, 14) Me.PictureBox1.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(172, 156) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 0 Me.PictureBox1.TabStop = False ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(202, 34) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(56, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Radius:" ' 'txtRadius ' Me.txtRadius.Location = New System.Drawing.Point(202, 58) Me.txtRadius.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtRadius.Name = "txtRadius" Me.txtRadius.Size = New System.Drawing.Size(70, 27) Me.txtRadius.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(202, 89) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(43, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Area:" ' 'lblArea ' Me.lblArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblArea.Location = New System.Drawing.Point(202, 109) Me.lblArea.Name = "lblArea" Me.lblArea.Size = New System.Drawing.Size(93, 32) Me.lblArea.TabIndex = 5 Me.lblArea.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(125, 201) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(88, 31) Me.btnCalc.TabIndex = 2 Me.btnCalc.Text = "&Calculate" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(219, 201) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 31) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(325, 255) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.lblArea) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtRadius) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.PictureBox1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Circle Area" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtRadius As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents lblArea As System.Windows.Forms.Label Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class
Chap26/Circle Area Solution/Circle Area Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True
Chap26/Circle Area Solution/Circle Area Project/frmMain.vb
' Name: Circle Area Project ' Purpose: Display the area of a circle ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class
Chap26/Circle Area Solution/Circle Area Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Circle_Area_Project.frmMain End Sub End Class End Namespace
Chap26/Circle Area Solution/Circle Area Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Circle Area Solution/Circle Area Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Circle Area Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Circle Area Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("8dd771b0-4d21-4413-9563-c8ee88be8b63")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Circle Area Solution/Circle Area Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Circle_Area_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Circle() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Circle", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Circle Area Solution/Circle Area Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Circle Area Solution/Circle Area Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Circle_Area_Project.My.MySettings Get Return Global.Circle_Area_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Circle Area Solution/Circle Area Project/My Project/Settings.settings
Chap26/Circle Area Solution/Circle Area Project/Resources/Circle.png
Chap26/Circle Area Solution/Circle Area Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Circle Area Project", "Circle Area Project\Circle Area Project.vbproj", "{2ADF401D-88F8-4250-8EE4-78B9A98DB30E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2ADF401D-88F8-4250-8EE4-78B9A98DB30E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2ADF401D-88F8-4250-8EE4-78B9A98DB30E}.Debug|Any CPU.Build.0 = Debug|Any CPU {2ADF401D-88F8-4250-8EE4-78B9A98DB30E}.Release|Any CPU.ActiveCfg = Release|Any CPU {2ADF401D-88F8-4250-8EE4-78B9A98DB30E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/FigureThisOut Solution/FigureThisOut Project/App.config
Chap26/FigureThisOut Solution/FigureThisOut Project/FigureThisOut Project.vbproj
Debug AnyCPU {9045A2F0-0CB1-4805-90B6-358F03404491} WinExe FigureThisOut_Project.My.MyApplication FigureThisOut_Project FigureThisOut Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ FigureThisOut Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ FigureThisOut Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/FigureThisOut Solution/FigureThisOut Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtFirst = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtLast = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.lblFullName = New System.Windows.Forms.Label() Me.btnDefault = New System.Windows.Forms.Button() Me.btnParameterized = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(31, 32) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(71, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&First name:" ' 'txtFirst ' Me.txtFirst.Location = New System.Drawing.Point(31, 53) Me.txtFirst.Name = "txtFirst" Me.txtFirst.Size = New System.Drawing.Size(142, 25) Me.txtFirst.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(209, 32) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(70, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Last name:" ' 'txtLast ' Me.txtLast.Location = New System.Drawing.Point(212, 53) Me.txtLast.Name = "txtLast" Me.txtLast.Size = New System.Drawing.Size(228, 25) Me.txtLast.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(31, 85) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(66, 17) Me.Label3.TabIndex = 7 Me.Label3.Text = "Full name:" ' 'lblFullName ' Me.lblFullName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblFullName.Location = New System.Drawing.Point(31, 104) Me.lblFullName.Name = "lblFullName" Me.lblFullName.Size = New System.Drawing.Size(409, 25) Me.lblFullName.TabIndex = 8 Me.lblFullName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDefault ' Me.btnDefault.Location = New System.Drawing.Point(34, 161) Me.btnDefault.Name = "btnDefault" Me.btnDefault.Size = New System.Drawing.Size(189, 42) Me.btnDefault.TabIndex = 4 Me.btnDefault.Text = "Display - &Default Constructor" Me.btnDefault.UseVisualStyleBackColor = True ' 'btnParameterized ' Me.btnParameterized.Location = New System.Drawing.Point(229, 161) Me.btnParameterized.Name = "btnParameterized" Me.btnParameterized.Size = New System.Drawing.Size(236, 42) Me.btnParameterized.TabIndex = 5 Me.btnParameterized.Text = "Display - &Parameterized Constructor" Me.btnParameterized.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(471, 161) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(70, 42) Me.btnExit.TabIndex = 6 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(573, 227) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnParameterized) Me.Controls.Add(Me.btnDefault) Me.Controls.Add(Me.lblFullName) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtLast) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtFirst) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "FigureThisOut" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtFirst As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtLast As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblFullName As System.Windows.Forms.Label Friend WithEvents btnDefault As System.Windows.Forms.Button Friend WithEvents btnParameterized As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class
Chap26/FigureThisOut Solution/FigureThisOut Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True
Chap26/FigureThisOut Solution/FigureThisOut Project/frmMain.vb
' Name: FigureThisOut Project ' Purpose: Display the full name ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnDefault_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDefault.Click ' display the full name ' instantiate the object using the default constructor Dim names As New Person names.First = txtFirst.Text names.Last = txtLast.Text lblFullName.Text = names.GetFullName End Sub Private Sub btnParameterized_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnParameterized.Click ' display the full name ' instantiate the object using the parameterized constructor Dim names As New Person(txtFirst.Text, txtLast.Text) lblFullName.Text = names.GetFullName End Sub Private Sub txtFirst_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFirst.TextChanged lblFullName.Text = String.Empty End Sub Private Sub txtLast_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtLast.TextChanged lblFullName.Text = String.Empty End Sub End Class
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.FigureThisOut_Project.frmMain End Sub End Class End Namespace
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("FigureThisOut Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("FigureThisOut Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("425ccbbb-27d8-406f-9336-206b6252109e")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("FigureThisOut_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.FigureThisOut_Project.My.MySettings Get Return Global.FigureThisOut_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/FigureThisOut Solution/FigureThisOut Project/My Project/Settings.settings
Chap26/FigureThisOut Solution/FigureThisOut Project/Person.vb
Public Class Person Private _strFirst As String Private _strLast As String Public Property First() As String Get Return _strFirst End Get Set(value As String) _strFirst = value End Set End Property Public Property Last() As String Get Return _strLast End Get Set(value As String) _strLast = value End Set End Property Public Sub New() ' default constructor _strFirst = String.Empty _strLast = String.Empty End Sub Public Sub New(ByVal strName1 As String, ByVal strName2 As String) ' parameterized constructor First = strName1 Last = strName2 End Sub Public Function GetFullName() As String Return _strFirst & " " & _strLast End Function End Class
Chap26/FigureThisOut Solution/FigureThisOut Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "FigureThisOut Project", "FigureThisOut Project\FigureThisOut Project.vbproj", "{9045A2F0-0CB1-4805-90B6-358F03404491}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9045A2F0-0CB1-4805-90B6-358F03404491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9045A2F0-0CB1-4805-90B6-358F03404491}.Debug|Any CPU.Build.0 = Debug|Any CPU {9045A2F0-0CB1-4805-90B6-358F03404491}.Release|Any CPU.ActiveCfg = Release|Any CPU {9045A2F0-0CB1-4805-90B6-358F03404491}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Grade Solution/Grade Project/App.config
Chap26/Grade Solution/Grade Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.lblGrade = New System.Windows.Forms.Label() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.txtTest1 = New System.Windows.Forms.TextBox() Me.txtTest2 = New System.Windows.Forms.TextBox() Me.txtTest3 = New System.Windows.Forms.TextBox() Me.Label4 = New System.Windows.Forms.Label() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(74, 32) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(99, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Test &1 (0 - 100):" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(74, 67) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(99, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "Test &2 (0 - 100):" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(74, 151) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(47, 17) Me.Label3.TabIndex = 8 Me.Label3.Text = "Grade:" ' 'lblGrade ' Me.lblGrade.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblGrade.Location = New System.Drawing.Point(125, 147) Me.lblGrade.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblGrade.Name = "lblGrade" Me.lblGrade.Size = New System.Drawing.Size(87, 25) Me.lblGrade.TabIndex = 9 Me.lblGrade.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(231, 29) Me.btnDisplay.Margin = New System.Windows.Forms.Padding(2) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(102, 30) Me.btnDisplay.TabIndex = 6 Me.btnDisplay.Text = "&Display Grade" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(231, 63) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(102, 30) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'txtTest1 ' Me.txtTest1.Location = New System.Drawing.Point(174, 29) Me.txtTest1.Name = "txtTest1" Me.txtTest1.Size = New System.Drawing.Size(40, 25) Me.txtTest1.TabIndex = 1 ' 'txtTest2 ' Me.txtTest2.Location = New System.Drawing.Point(174, 64) Me.txtTest2.Name = "txtTest2" Me.txtTest2.Size = New System.Drawing.Size(40, 25) Me.txtTest2.TabIndex = 3 ' 'txtTest3 ' Me.txtTest3.Location = New System.Drawing.Point(174, 101) Me.txtTest3.Name = "txtTest3" Me.txtTest3.Size = New System.Drawing.Size(40, 25) Me.txtTest3.TabIndex = 5 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(74, 104) Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(99, 17) Me.Label4.TabIndex = 4 Me.Label4.Text = "Test &3 (0 - 100):" ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Grade_Project.My.Resources.Resources.Grades Me.PictureBox1.Location = New System.Drawing.Point(13, 13) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(38, 188) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 10 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(358, 213) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.txtTest3) Me.Controls.Add(Me.txtTest2) Me.Controls.Add(Me.txtTest1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblGrade) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.MaximizeBox = False Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Grade Calculator" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblGrade As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents txtTest1 As System.Windows.Forms.TextBox Friend WithEvents txtTest2 As System.Windows.Forms.TextBox Friend WithEvents txtTest3 As System.Windows.Forms.TextBox Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class
Chap26/Grade Solution/Grade Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True
Chap26/Grade Solution/Grade Project/frmMain.vb
' Name: Grade Project ' Purpose: Display a grade ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub txtTest1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTest1.KeyPress ' allows the text box to accept numbers and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtTest2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTest2.KeyPress ' allows the text box to accept numbers and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtTest3_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtTest3.KeyPress ' allows the text box to accept numbers and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtTest1_TextChanged(sender As Object, e As EventArgs) Handles txtTest1.TextChanged lblGrade.Text = String.Empty End Sub Private Sub txtTest2_TextChanged(sender As Object, e As EventArgs) Handles txtTest2.TextChanged lblGrade.Text = String.Empty End Sub Private Sub txtTest3_TextChanged(sender As Object, e As EventArgs) Handles txtTest3.TextChanged lblGrade.Text = String.Empty End Sub Private Sub btnDisplay_Click(sender As Object, e As EventArgs) Handles btnDisplay.Click ' display the letter grade End Sub End Class
Chap26/Grade Solution/Grade Project/Grade Project.vbproj
Debug AnyCPU {11BD02A6-A3A2-4AAB-99A0-AA80DCE768BD} WinExe Grade_Project.My.MyApplication Grade_Project Grade Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Grade Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Grade Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Grade Solution/Grade Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Grade_Project.frmMain End Sub End Class End Namespace
Chap26/Grade Solution/Grade Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Grade Solution/Grade Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Grade Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Grade Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("e511df91-af44-4182-9ae8-9334310caef8")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Grade Solution/Grade Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Grade_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Grades() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Grades", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Grade Solution/Grade Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Grades.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Grade Solution/Grade Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Grade_Project.My.MySettings Get Return Global.Grade_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Grade Solution/Grade Project/My Project/Settings.settings
Chap26/Grade Solution/Grade Project/Resources/Grades.png
Chap26/Grade Solution/Grade Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Grade Project", "Grade Project\Grade Project.vbproj", "{11BD02A6-A3A2-4AAB-99A0-AA80DCE768BD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {11BD02A6-A3A2-4AAB-99A0-AA80DCE768BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {11BD02A6-A3A2-4AAB-99A0-AA80DCE768BD}.Debug|Any CPU.Build.0 = Debug|Any CPU {11BD02A6-A3A2-4AAB-99A0-AA80DCE768BD}.Release|Any CPU.ActiveCfg = Release|Any CPU {11BD02A6-A3A2-4AAB-99A0-AA80DCE768BD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Pool Supplies Solution/Pool Supplies Project/App.config
Chap26/Pool Supplies Solution/Pool Supplies Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.lblGallons = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.btnExit = New System.Windows.Forms.Button() Me.btnCalc = New System.Windows.Forms.Button() Me.txtDepth = New System.Windows.Forms.TextBox() Me.txtWidth = New System.Windows.Forms.TextBox() Me.txtLength = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label() Me.lblClarifier = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'lblGallons ' Me.lblGallons.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblGallons.Location = New System.Drawing.Point(222, 182) Me.lblGallons.Name = "lblGallons" Me.lblGallons.Size = New System.Drawing.Size(83, 35) Me.lblGallons.TabIndex = 9 Me.lblGallons.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(30, 191) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(171, 20) Me.Label4.TabIndex = 8 Me.Label4.Text = "Gallons of water in pool:" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(210, 82) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(95, 33) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(210, 38) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(95, 33) Me.btnCalc.TabIndex = 6 Me.btnCalc.Text = "&Calculate" ' 'txtDepth ' Me.txtDepth.Location = New System.Drawing.Point(88, 127) Me.txtDepth.Margin = New System.Windows.Forms.Padding(2) Me.txtDepth.Name = "txtDepth" Me.txtDepth.Size = New System.Drawing.Size(70, 27) Me.txtDepth.TabIndex = 5 ' 'txtWidth ' Me.txtWidth.Location = New System.Drawing.Point(88, 82) Me.txtWidth.Margin = New System.Windows.Forms.Padding(2) Me.txtWidth.Name = "txtWidth" Me.txtWidth.Size = New System.Drawing.Size(70, 27) Me.txtWidth.TabIndex = 3 ' 'txtLength ' Me.txtLength.Location = New System.Drawing.Point(88, 38) Me.txtLength.Margin = New System.Windows.Forms.Padding(2) Me.txtLength.Name = "txtLength" Me.txtLength.Size = New System.Drawing.Size(70, 27) Me.txtLength.TabIndex = 1 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(30, 127) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(53, 20) Me.Label3.TabIndex = 4 Me.Label3.Text = "&Depth:" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(30, 82) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(52, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Width:" ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(30, 38) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(57, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Length:" ' 'lblClarifier ' Me.lblClarifier.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblClarifier.Location = New System.Drawing.Point(222, 227) Me.lblClarifier.Name = "lblClarifier" Me.lblClarifier.Size = New System.Drawing.Size(83, 35) Me.lblClarifier.TabIndex = 11 Me.lblClarifier.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(30, 235) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(187, 20) Me.Label5.TabIndex = 10 Me.Label5.Text = "Ounces of SoClear clarifier:" ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(347, 291) Me.Controls.Add(Me.lblClarifier) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.lblGallons) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.txtDepth) Me.Controls.Add(Me.txtWidth) Me.Controls.Add(Me.txtLength) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Pool Supplies" Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents lblGallons As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents txtDepth As System.Windows.Forms.TextBox Friend WithEvents txtWidth As System.Windows.Forms.TextBox Friend WithEvents txtLength As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblClarifier As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label End Class
Chap26/Pool Supplies Solution/Pool Supplies Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True True
Chap26/Pool Supplies Solution/Pool Supplies Project/frmMain.vb
' Name: Pool Supplies Project ' Purpose: Display the number of gallons contained in a rectangular ' pool and the number of ounces of clarifier needed ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates and displays the number of gallons ' in a pool and the number of ounces of ' clarifier needed End Sub Private Sub txtLength_TextChanged(sender As Object, e As EventArgs) Handles txtLength.TextChanged lblGallons.Text = String.Empty lblClarifier.Text = String.Empty End Sub Private Sub txtWidth_TextChanged(sender As Object, e As EventArgs) Handles txtWidth.TextChanged lblGallons.Text = String.Empty lblClarifier.Text = String.Empty End Sub Private Sub txtDepth_TextChanged(sender As Object, e As EventArgs) Handles txtDepth.TextChanged lblGallons.Text = String.Empty lblClarifier.Text = String.Empty End Sub End Class
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Pool_Supplies_Project.frmMain End Sub End Class End Namespace
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Pool Supplies Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Pool Supplies Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("e621f6c8-8606-4574-9b5f-a7efe5d64039")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Pool_Supplies_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Pool_Supplies_Project.My.MySettings Get Return Global.Pool_Supplies_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Pool Supplies Solution/Pool Supplies Project/My Project/Settings.settings
Chap26/Pool Supplies Solution/Pool Supplies Project/Pool Supplies Project.vbproj
Debug AnyCPU {04C9FBBA-2898-47F4-80C8-8BFD78AB77AE} WinExe Pool_Supplies_Project.My.MyApplication Pool_Supplies_Project Pool Supplies Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Pool Supplies Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Pool Supplies Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Pool Supplies Solution/Pool Supplies Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Pool Supplies Project", "Pool Supplies Project\Pool Supplies Project.vbproj", "{04C9FBBA-2898-47F4-80C8-8BFD78AB77AE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {04C9FBBA-2898-47F4-80C8-8BFD78AB77AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {04C9FBBA-2898-47F4-80C8-8BFD78AB77AE}.Debug|Any CPU.Build.0 = Debug|Any CPU {04C9FBBA-2898-47F4-80C8-8BFD78AB77AE}.Release|Any CPU.ActiveCfg = Release|Any CPU {04C9FBBA-2898-47F4-80C8-8BFD78AB77AE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Square Box Solution/Square Box Project/App.config
Chap26/Square Box Solution/Square Box Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtSide = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.lblArea = New System.Windows.Forms.Label() Me.lblPerimeter = New System.Windows.Forms.Label() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(121, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(135, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Side measurement:" ' 'txtSide ' Me.txtSide.Location = New System.Drawing.Point(260, 21) Me.txtSide.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.txtSide.Name = "txtSide" Me.txtSide.Size = New System.Drawing.Size(60, 27) Me.txtSide.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(121, 80) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(43, 20) Me.Label2.TabIndex = 4 Me.Label2.Text = "Area:" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(235, 80) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(76, 20) Me.Label3.TabIndex = 6 Me.Label3.Text = "Perimeter:" ' 'lblArea ' Me.lblArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblArea.Location = New System.Drawing.Point(121, 107) Me.lblArea.Name = "lblArea" Me.lblArea.Size = New System.Drawing.Size(82, 26) Me.lblArea.TabIndex = 5 Me.lblArea.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'lblPerimeter ' Me.lblPerimeter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblPerimeter.Location = New System.Drawing.Point(239, 107) Me.lblPerimeter.Name = "lblPerimeter" Me.lblPerimeter.Size = New System.Drawing.Size(82, 26) Me.lblPerimeter.TabIndex = 7 Me.lblPerimeter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(121, 155) Me.btnDisplay.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(86, 35) Me.btnDisplay.TabIndex = 2 Me.btnDisplay.Text = "&Display" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(235, 155) Me.btnExit.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(86, 35) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Square_Box_Project.My.Resources.Resources.Square Me.PictureBox1.Location = New System.Drawing.Point(13, 25) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(91, 91) Me.PictureBox1.TabIndex = 8 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(348, 215) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.lblPerimeter) Me.Controls.Add(Me.lblArea) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtSide) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 6, 3, 6) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Square Box Calculator" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtSide As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents lblArea As System.Windows.Forms.Label Friend WithEvents lblPerimeter As System.Windows.Forms.Label Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class
Chap26/Square Box Solution/Square Box Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True
Chap26/Square Box Solution/Square Box Project/frmMain.vb
' Name: Square Box Project ' Purpose: Display the area and perimeter of a square ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub txtSide_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtSide.KeyPress ' allows the text box to accept numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtSide_TextChanged(sender As Object, e As EventArgs) Handles txtSide.TextChanged lblArea.Text = String.Empty lblPerimeter.Text = String.Empty End Sub End Class
Chap26/Square Box Solution/Square Box Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Square_Box_Project.frmMain End Sub End Class End Namespace
Chap26/Square Box Solution/Square Box Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Square Box Solution/Square Box Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Square Box Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Square Box Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("2d646c42-e1b0-4cde-a7ed-40300f63b0f8")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Square Box Solution/Square Box Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Square_Box_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Square() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Square", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Square Box Solution/Square Box Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Square.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Square Box Solution/Square Box Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Square_Box_Project.My.MySettings Get Return Global.Square_Box_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Square Box Solution/Square Box Project/My Project/Settings.settings
Chap26/Square Box Solution/Square Box Project/Resources/Square.png
Chap26/Square Box Solution/Square Box Project/Square Box Project.vbproj
Debug AnyCPU {859C08AA-1F8F-48B2-841E-064AC6BA781B} WinExe Square_Box_Project.My.MyApplication Square_Box_Project Square Box Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Square Box Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Square Box Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Square Box Solution/Square Box Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Square Box Project", "Square Box Project\Square Box Project.vbproj", "{859C08AA-1F8F-48B2-841E-064AC6BA781B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {859C08AA-1F8F-48B2-841E-064AC6BA781B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {859C08AA-1F8F-48B2-841E-064AC6BA781B}.Debug|Any CPU.Build.0 = Debug|Any CPU {859C08AA-1F8F-48B2-841E-064AC6BA781B}.Release|Any CPU.ActiveCfg = Release|Any CPU {859C08AA-1F8F-48B2-841E-064AC6BA781B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/SwatTheBugs Solution/SwatTheBugs Project/App.config
Chap26/SwatTheBugs Solution/SwatTheBugs Project/Computer.vb
Public Class Computer Private _strId As String Private _decPrice As Decimal Public Property Id As String Get Return _strId End Get Set(value As String) _strId = value End Set End Property Public Property Price As Decimal Get Return _decPrice End Get Set(value As Decimal) End Set End Property Public Sub New() _strId = String.Empty _decPrice = 0 End Sub Public Function GetNewPrice(ByVal decDiscountRate As Decimal) As Decimal Return _decPrice - _decPrice * decDiscountRate End Function End Class
Chap26/SwatTheBugs Solution/SwatTheBugs Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.txtModel = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.lblNewPrice = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.btnExit = New System.Windows.Forms.Button() Me.btnCalc = New System.Windows.Forms.Button() Me.Label3 = New System.Windows.Forms.Label() Me.txtOriginal = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtDiscountRate = New System.Windows.Forms.TextBox() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'txtModel ' Me.txtModel.Location = New System.Drawing.Point(22, 41) Me.txtModel.Margin = New System.Windows.Forms.Padding(2) Me.txtModel.Name = "txtModel" Me.txtModel.Size = New System.Drawing.Size(101, 25) Me.txtModel.TabIndex = 1 ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(22, 21) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(49, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "&Model:" ' 'lblNewPrice ' Me.lblNewPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.lblNewPrice.Location = New System.Drawing.Point(464, 41) Me.lblNewPrice.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblNewPrice.Name = "lblNewPrice" Me.lblNewPrice.Size = New System.Drawing.Size(101, 25) Me.lblNewPrice.TabIndex = 9 Me.lblNewPrice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(464, 21) Me.Label4.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(70, 17) Me.Label4.TabIndex = 8 Me.Label4.Text = "New price:" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(486, 97) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(79, 33) Me.btnExit.TabIndex = 7 Me.btnExit.Text = "E&xit" ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(351, 97) Me.btnCalc.Margin = New System.Windows.Forms.Padding(2) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(131, 33) Me.btnCalc.TabIndex = 6 Me.btnCalc.Text = "&Calculate New Price" ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(248, 21) Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(194, 17) Me.Label3.TabIndex = 4 Me.Label3.Text = "&Discount rate (for example, .05):" ' 'txtOriginal ' Me.txtOriginal.Location = New System.Drawing.Point(138, 41) Me.txtOriginal.Margin = New System.Windows.Forms.Padding(2) Me.txtOriginal.Name = "txtOriginal" Me.txtOriginal.Size = New System.Drawing.Size(65, 25) Me.txtOriginal.TabIndex = 3 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(138, 21) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(90, 17) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Original price:" ' 'txtDiscountRate ' Me.txtDiscountRate.Location = New System.Drawing.Point(248, 41) Me.txtDiscountRate.Name = "txtDiscountRate" Me.txtDiscountRate.Size = New System.Drawing.Size(65, 25) Me.txtDiscountRate.TabIndex = 5 ' 'PictureBox1 ' Me.PictureBox1.Image = Global.SwatTheBugs_Project.My.Resources.Resources.computer Me.PictureBox1.Location = New System.Drawing.Point(25, 81) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(84, 64) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 10 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(589, 157) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.txtDiscountRate) Me.Controls.Add(Me.txtModel) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.lblNewPrice) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.txtOriginal) Me.Controls.Add(Me.Label2) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 5, 3, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "SwatTheBugs" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents txtModel As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents lblNewPrice As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents txtOriginal As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtDiscountRate As System.Windows.Forms.TextBox Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class
Chap26/SwatTheBugs Solution/SwatTheBugs Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True True True True True
Chap26/SwatTheBugs Solution/SwatTheBugs Project/frmMain.vb
' Name: SwatTheBugs Project ' Purpose: Display the new price of a computer ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click ' calculates the new price for a computer Dim computerPurchased As Computer Dim decRate As Decimal Dim decNewPrice As Decimal Decimal.TryParse(txtOriginal.Text, Computer.Price) Computer.Id = txtModel.Text Decimal.TryParse(txtDiscountRate.Text, decRate) decNewPrice = Computer.GetNewPrice(decRate) lblNewPrice.Text = decNewPrice.ToString("C2") End Sub Private Sub txtDiscountRate_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtDiscountRate.KeyPress ' allows the text box to accept numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtOriginal_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtOriginal.KeyPress ' allows the text box to accept numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub Private Sub txtModel_TextChanged(sender As Object, e As EventArgs) Handles txtModel.TextChanged lblNewPrice.Text = String.Empty End Sub Private Sub txtDiscountRate_TextChanged(sender As Object, e As EventArgs) Handles txtDiscountRate.TextChanged lblNewPrice.Text = String.Empty End Sub Private Sub txtOriginal_TextChanged(sender As Object, e As EventArgs) Handles txtOriginal.TextChanged lblNewPrice.Text = String.Empty End Sub End Class
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.SwatTheBugs_Project.frmMain End Sub End Class End Namespace
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("SwatTheBugs Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("SwatTheBugs Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("c034a539-998d-4bd2-ade7-0c7101d81b05")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SwatTheBugs_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property computer() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("computer", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\computer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.SwatTheBugs_Project.My.MySettings Get Return Global.SwatTheBugs_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/SwatTheBugs Solution/SwatTheBugs Project/My Project/Settings.settings
Chap26/SwatTheBugs Solution/SwatTheBugs Project/Resources/computer.png
Chap26/SwatTheBugs Solution/SwatTheBugs Project/SwatTheBugs Project.vbproj
Debug AnyCPU {DF73A6BC-CE3F-484B-ABBB-164A1F8A06B4} WinExe SwatTheBugs_Project.My.MyApplication SwatTheBugs_Project SwatTheBugs Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ SwatTheBugs Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ SwatTheBugs Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/SwatTheBugs Solution/SwatTheBugs Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SwatTheBugs Project", "SwatTheBugs Project\SwatTheBugs Project.vbproj", "{DF73A6BC-CE3F-484B-ABBB-164A1F8A06B4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {DF73A6BC-CE3F-484B-ABBB-164A1F8A06B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DF73A6BC-CE3F-484B-ABBB-164A1F8A06B4}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF73A6BC-CE3F-484B-ABBB-164A1F8A06B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF73A6BC-CE3F-484B-ABBB-164A1F8A06B4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap26/Sweets Solution/Sweets Project/App.config
Chap26/Sweets Solution/Sweets Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Public Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing AndAlso components IsNot Nothing Then components.Dispose() End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label() Me.txtId = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtSales = New System.Windows.Forms.TextBox() Me.btnSave = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.PictureBox1 = New System.Windows.Forms.PictureBox() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(128, 27) Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(110, 20) Me.Label1.TabIndex = 0 Me.Label1.Text = "Salesperson &ID:" ' 'txtId ' Me.txtId.Location = New System.Drawing.Point(129, 52) Me.txtId.Margin = New System.Windows.Forms.Padding(2) Me.txtId.Name = "txtId" Me.txtId.Size = New System.Drawing.Size(63, 27) Me.txtId.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(274, 27) Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(109, 20) Me.Label2.TabIndex = 2 Me.Label2.Text = "&Quarterly sales:" ' 'txtSales ' Me.txtSales.Location = New System.Drawing.Point(276, 53) Me.txtSales.Margin = New System.Windows.Forms.Padding(2) Me.txtSales.Name = "txtSales" Me.txtSales.Size = New System.Drawing.Size(109, 27) Me.txtSales.TabIndex = 3 ' 'btnSave ' Me.btnSave.Location = New System.Drawing.Point(231, 119) Me.btnSave.Margin = New System.Windows.Forms.Padding(2) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 40) Me.btnSave.TabIndex = 4 Me.btnSave.Text = "&Save" ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(311, 119) Me.btnExit.Margin = New System.Windows.Forms.Padding(2) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 40) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" ' 'PictureBox1 ' Me.PictureBox1.Image = Global.Sweets_Project.My.Resources.Resources.Cake Me.PictureBox1.Location = New System.Drawing.Point(13, 13) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(110, 109) Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox1.TabIndex = 6 Me.PictureBox1.TabStop = False ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(415, 193) Me.Controls.Add(Me.PictureBox1) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.txtSales) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.txtId) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.MaximizeBox = False Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Sweets Unlimited" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtId As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtSales As System.Windows.Forms.TextBox Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox End Class
Chap26/Sweets Solution/Sweets Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True True
Chap26/Sweets Solution/Sweets Project/frmMain.vb
' Name: Sweets Project ' Purpose: Writes the salesperson's ID and sales amount to a sequential access file ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click ' writes the ID and sales amount to a file Const strTITLE As String = "Sweets Unlimited" Dim outFile As IO.StreamWriter ' instantiate a Salesperson object If txtId.Text <> String.Empty AndAlso txtSales.Text <> String.Empty Then ' if both text boxes contain data, assign the ' ID and sales amount to the Salesperson object ' save the information outFile = IO.File.AppendText("sales.txt") outFile.Close() MessageBox.Show("Sales information saved.", strTITLE, MessageBoxButtons.OK, MessageBoxIcon.Information) Else MessageBox.Show("Please enter a name and a sales amount.", strTITLE, MessageBoxButtons.OK, MessageBoxIcon.Information) End If txtId.Text = String.Empty txtSales.Text = String.Empty txtId.Focus() End Sub Private Sub txtSales_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtSales.KeyPress ' allows the text box to accept only numbers, the period, and the Backspace key If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then e.Handled = True End If End Sub End Class
Chap26/Sweets Solution/Sweets Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Sweets_Project.frmMain End Sub End Class End Namespace
Chap26/Sweets Solution/Sweets Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap26/Sweets Solution/Sweets Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Sweets Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("Sweets Project")> <Assembly: AssemblyCopyright("Copyright © 2013")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("f4ca8690-003c-4e14-b127-fc63b4601cbf")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap26/Sweets Solution/Sweets Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Sweets_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property '''<summary> ''' Looks up a localized resource of type System.Drawing.Bitmap. '''</summary> Friend ReadOnly Property Cake() As System.Drawing.Bitmap Get Dim obj As Object = ResourceManager.GetObject("Cake", resourceCulture) Return CType(obj,System.Drawing.Bitmap) End Get End Property End Module End Namespace
Chap26/Sweets Solution/Sweets Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\Cake.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Chap26/Sweets Solution/Sweets Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Sweets_Project.My.MySettings Get Return Global.Sweets_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap26/Sweets Solution/Sweets Project/My Project/Settings.settings
Chap26/Sweets Solution/Sweets Project/Resources/Cake.png
Chap26/Sweets Solution/Sweets Project/Sweets Project.vbproj
Debug AnyCPU {2A897114-7B63-4875-8654-BB4D5C1CAFEC} WinExe Sweets_Project.My.MyApplication Sweets_Project Sweets Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ Sweets Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ Sweets Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap26/Sweets Solution/Sweets Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Sweets Project", "Sweets Project\Sweets Project.vbproj", "{2A897114-7B63-4875-8654-BB4D5C1CAFEC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2A897114-7B63-4875-8654-BB4D5C1CAFEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2A897114-7B63-4875-8654-BB4D5C1CAFEC}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A897114-7B63-4875-8654-BB4D5C1CAFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A897114-7B63-4875-8654-BB4D5C1CAFEC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/Addison Playhouse Solution/Addison Playhouse Project/Addison Playhouse Project.vbproj
Debug x86 2.0 {8F6BE7CD-9238-4FF3-9570-61794EF9284A} WinExe Addison_Playhouse_Project.My.MyApplication Addison_Playhouse_Project Addison Playhouse Project 512 WindowsForms v4.5 x86 true full true true bin\Debug\ Addison Playhouse Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false x86 pdbonly false true true bin\Release\ Addison Playhouse Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True True True PlayDataSet.xsd frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb PlayDataSet.xsd MSDataSetGenerator PlayDataSet.Designer.vb Designer PlayDataSet.xsd Always
Chap25/Addison Playhouse Solution/Addison Playhouse Project/app.config
Chap25/Addison Playhouse Solution/Addison Playhouse Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.TblReservationsDataGridView = New System.Windows.Forms.DataGridView() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.TblReservationsBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.PlayDataSet = New Addison_Playhouse_Project.PlayDataSet() Me.TblReservationsTableAdapter = New Addison_Playhouse_Project.PlayDataSetTableAdapters.tblReservationsTableAdapter() Me.TableAdapterManager = New Addison_Playhouse_Project.PlayDataSetTableAdapters.TableAdapterManager() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() CType(Me.TblReservationsDataGridView, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblReservationsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PlayDataSet, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'TblReservationsDataGridView ' Me.TblReservationsDataGridView.AllowUserToAddRows = False Me.TblReservationsDataGridView.AllowUserToDeleteRows = False Me.TblReservationsDataGridView.AutoGenerateColumns = False Me.TblReservationsDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.TblReservationsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.TblReservationsDataGridView.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3}) Me.TblReservationsDataGridView.DataSource = Me.TblReservationsBindingSource Me.TblReservationsDataGridView.Location = New System.Drawing.Point(19, 22) Me.TblReservationsDataGridView.Name = "TblReservationsDataGridView" Me.TblReservationsDataGridView.ReadOnly = True Me.TblReservationsDataGridView.RowHeadersVisible = False Me.TblReservationsDataGridView.Size = New System.Drawing.Size(363, 220) Me.TblReservationsDataGridView.TabIndex = 2 ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(130, 257) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(171, 28) Me.btnDisplay.TabIndex = 0 Me.btnDisplay.Text = "&Display Patron" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(307, 257) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 28) Me.btnExit.TabIndex = 1 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'TblReservationsBindingSource ' Me.TblReservationsBindingSource.DataMember = "tblReservations" Me.TblReservationsBindingSource.DataSource = Me.PlayDataSet ' 'PlayDataSet ' Me.PlayDataSet.DataSetName = "PlayDataSet" Me.PlayDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' 'TblReservationsTableAdapter ' Me.TblReservationsTableAdapter.ClearBeforeFill = True ' 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.tblReservationsTableAdapter = Me.TblReservationsTableAdapter Me.TableAdapterManager.UpdateOrder = Addison_Playhouse_Project.PlayDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn1.DataPropertyName = "Seat" Me.DataGridViewTextBoxColumn1.HeaderText = "Seat" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 58 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells Me.DataGridViewTextBoxColumn2.DataPropertyName = "Patron" Me.DataGridViewTextBoxColumn2.HeaderText = "Patron" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True Me.DataGridViewTextBoxColumn2.Width = 71 ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.DataPropertyName = "Phone" Me.DataGridViewTextBoxColumn3.HeaderText = "Phone" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(402, 308) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.TblReservationsDataGridView) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.MaximizeBox = False Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Addison Playhouse" CType(Me.TblReservationsDataGridView, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblReservationsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PlayDataSet, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents PlayDataSet As Addison_Playhouse_Project.PlayDataSet Friend WithEvents TblReservationsBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TblReservationsTableAdapter As Addison_Playhouse_Project.PlayDataSetTableAdapters.tblReservationsTableAdapter Friend WithEvents TableAdapterManager As Addison_Playhouse_Project.PlayDataSetTableAdapters.TableAdapterManager Friend WithEvents TblReservationsDataGridView As System.Windows.Forms.DataGridView Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn End Class
Chap25/Addison Playhouse Solution/Addison Playhouse Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True 133, 17 17, 17 True True 17, 17 349, 17 17, 56 True
Chap25/Addison Playhouse Solution/Addison Playhouse Project/frmMain.vb
' Name: Addison Playhouse Project ' Purpose: Displays either all records or only records ' whose name begins with the one or more ' characters entered by the user ' Programmer: <your name> on <current date> Public Class frmMain Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'PlayDataSet.tblReservations' table. You can move, or remove it, as needed. Me.TblReservationsTableAdapter.Fill(Me.PlayDataSet.tblReservations) End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Addison_Playhouse_Project.frmMain End Sub End Class End Namespace
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Addison Playhouse Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Microsoft")> <Assembly: AssemblyProduct("Addison Playhouse Project")> <Assembly: AssemblyCopyright("Copyright © Microsoft 2010")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("35f011f9-3118-41f3-8355-6bc9ea4304fe")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Addison_Playhouse_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Play.accdb")> _ Public ReadOnly Property PlayConnectionString() As String Get Return CType(Me("PlayConnectionString"),String) End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Addison_Playhouse_Project.My.MySettings Get Return Global.Addison_Playhouse_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap25/Addison Playhouse Solution/Addison Playhouse Project/My Project/Settings.settings
<?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Play.accdb</ConnectionString> <ProviderName>System.Data.OleDb</ProviderName> </SerializableConnectionString> Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Play.accdb
Chap25/Addison Playhouse Solution/Addison Playhouse Project/Play.accdb
| Seat | Patron | Phone |
|---|---|---|
| 1 | Jones, Jack | 111-1111 |
| 2 | Unzer, Phil | 111-1112 |
| 3 | Unzer, Carol | 111-1112 |
| 4 | Chan, Henry | 222-2222 |
| 5 | Chan, Sue | 222-2222 |
| 6 | Chan, Pat | 222-2222 |
| 7 | Martinez, Opal | 112-3456 |
| 8 | Jones, Henrietta | 334-4567 |
| 9 | Chaluna, Jose | 888-9999 |
| 10 | Jefferson, Paul | 333-4444 |
| 11 | Jefferson, Janet | 333-4444 |
| 12 | Jefferson, Kate | 333-5567 |
| 13 | Jefferson, Mike | 333-5567 |
| 14 | Garner, Hank | 222-4456 |
| 15 | Garner, Jenny | 222-4456 |
| 16 | Audorna, Abby | 333-9999 |
| 17 | Spitz, Shannon | 444-7777 |
| 18 | Tunnel, Ned | 567-3333 |
| 19 | Tunnel, Tina | 567-3333 |
| 20 | Esposito, Inez | 444-8988 |
Chap25/Addison Playhouse Solution/Addison Playhouse Project/PlayDataSet.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On '''<summary> '''Represents a strongly typed in-memory cache of data. '''</summary> <Global.System.Serializable(), _ Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _ Global.System.Xml.Serialization.XmlRootAttribute("PlayDataSet"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _ Partial Public Class PlayDataSet Inherits Global.System.Data.DataSet Private tabletblReservations As tblReservationsDataTable Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("tblReservations")) Is Nothing) Then MyBase.Tables.Add(New tblReservationsDataTable(ds.Tables("tblReservations"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false), _ Global.System.ComponentModel.DesignerSerializationVisibility(Global.System.ComponentModel.DesignerSerializationVisibility.Content)> _ Public ReadOnly Property tblReservations() As tblReservationsDataTable Get Return Me.tabletblReservations End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.BrowsableAttribute(true), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Visible)> _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As PlayDataSet = CType(MyBase.Clone,PlayDataSet) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXml(reader) If (Not (ds.Tables("tblReservations")) Is Nothing) Then MyBase.Tables.Add(New tblReservationsDataTable(ds.Tables("tblReservations"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tabletblReservations = CType(MyBase.Tables("tblReservations"),tblReservationsDataTable) If (initTable = true) Then If (Not (Me.tabletblReservations) Is Nothing) Then Me.tabletblReservations.InitVars End If End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.DataSetName = "PlayDataSet" Me.Prefix = "" Me.Namespace = "http://tempuri.org/PlayDataSet.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tabletblReservations = New tblReservationsDataTable() MyBase.Tables.Add(Me.tabletblReservations) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function ShouldSerializetblReservations() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As PlayDataSet = New PlayDataSet() Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Delegate Sub tblReservationsRowChangeEventHandler(ByVal sender As Object, ByVal e As tblReservationsRowChangeEvent) '''<summary> '''Represents the strongly named DataTable class. '''</summary> <Global.System.Serializable(), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _ Partial Public Class tblReservationsDataTable Inherits Global.System.Data.TypedTableBase(Of tblReservationsRow) Private columnSeat As Global.System.Data.DataColumn Private columnPatron As Global.System.Data.DataColumn Private columnPhone As Global.System.Data.DataColumn <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.TableName = "tblReservations" Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property SeatColumn() As Global.System.Data.DataColumn Get Return Me.columnSeat End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property PatronColumn() As Global.System.Data.DataColumn Get Return Me.columnPatron End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property PhoneColumn() As Global.System.Data.DataColumn Get Return Me.columnPhone End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Default ReadOnly Property Item(ByVal index As Integer) As tblReservationsRow Get Return CType(Me.Rows(index),tblReservationsRow) End Get End Property <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblReservationsRowChanging As tblReservationsRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblReservationsRowChanged As tblReservationsRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblReservationsRowDeleting As tblReservationsRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblReservationsRowDeleted As tblReservationsRowChangeEventHandler <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Sub AddtblReservationsRow(ByVal row As tblReservationsRow) Me.Rows.Add(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Function AddtblReservationsRow(ByVal Seat As Integer, ByVal Patron As String, ByVal Phone As String) As tblReservationsRow Dim rowtblReservationsRow As tblReservationsRow = CType(Me.NewRow,tblReservationsRow) Dim columnValuesArray() As Object = New Object() {Seat, Patron, Phone} rowtblReservationsRow.ItemArray = columnValuesArray Me.Rows.Add(rowtblReservationsRow) Return rowtblReservationsRow End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function FindBySeat(ByVal Seat As Integer) As tblReservationsRow Return CType(Me.Rows.Find(New Object() {Seat}),tblReservationsRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As tblReservationsDataTable = CType(MyBase.Clone,tblReservationsDataTable) cln.InitVars Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New tblReservationsDataTable() End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub InitVars() Me.columnSeat = MyBase.Columns("Seat") Me.columnPatron = MyBase.Columns("Patron") Me.columnPhone = MyBase.Columns("Phone") End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.columnSeat = New Global.System.Data.DataColumn("Seat", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnSeat) Me.columnPatron = New Global.System.Data.DataColumn("Patron", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnPatron) Me.columnPhone = New Global.System.Data.DataColumn("Phone", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnPhone) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnSeat}, true)) Me.columnSeat.AllowDBNull = false Me.columnSeat.Unique = true Me.columnPatron.MaxLength = 50 Me.columnPhone.MaxLength = 50 End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function NewtblReservationsRow() As tblReservationsRow Return CType(Me.NewRow,tblReservationsRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New tblReservationsRow(builder) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(tblReservationsRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.tblReservationsRowChangedEvent) Is Nothing) Then RaiseEvent tblReservationsRowChanged(Me, New tblReservationsRowChangeEvent(CType(e.Row,tblReservationsRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.tblReservationsRowChangingEvent) Is Nothing) Then RaiseEvent tblReservationsRowChanging(Me, New tblReservationsRowChangeEvent(CType(e.Row,tblReservationsRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.tblReservationsRowDeletedEvent) Is Nothing) Then RaiseEvent tblReservationsRowDeleted(Me, New tblReservationsRowChangeEvent(CType(e.Row,tblReservationsRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.tblReservationsRowDeletingEvent) Is Nothing) Then RaiseEvent tblReservationsRowDeleting(Me, New tblReservationsRowChangeEvent(CType(e.Row,tblReservationsRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub RemovetblReservationsRow(ByVal row As tblReservationsRow) Me.Rows.Remove(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As PlayDataSet = New PlayDataSet() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "tblReservationsDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class '''<summary> '''Represents strongly named DataRow class. '''</summary> Partial Public Class tblReservationsRow Inherits Global.System.Data.DataRow Private tabletblReservations As tblReservationsDataTable <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tabletblReservations = CType(Me.Table,tblReservationsDataTable) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Seat() As Integer Get Return CType(Me(Me.tabletblReservations.SeatColumn),Integer) End Get Set Me(Me.tabletblReservations.SeatColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Patron() As String Get Try Return CType(Me(Me.tabletblReservations.PatronColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Patron' in table 'tblReservations' is DBNull.", e) End Try End Get Set Me(Me.tabletblReservations.PatronColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Phone() As String Get Try Return CType(Me(Me.tabletblReservations.PhoneColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Phone' in table 'tblReservations' is DBNull.", e) End Try End Get Set Me(Me.tabletblReservations.PhoneColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsPatronNull() As Boolean Return Me.IsNull(Me.tabletblReservations.PatronColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetPatronNull() Me(Me.tabletblReservations.PatronColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsPhoneNull() As Boolean Return Me.IsNull(Me.tabletblReservations.PhoneColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetPhoneNull() Me(Me.tabletblReservations.PhoneColumn) = Global.System.Convert.DBNull End Sub End Class '''<summary> '''Row event argument class '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Class tblReservationsRowChangeEvent Inherits Global.System.EventArgs Private eventRow As tblReservationsRow Private eventAction As Global.System.Data.DataRowAction <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New(ByVal row As tblReservationsRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Row() As tblReservationsRow Get Return Me.eventRow End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace PlayDataSetTableAdapters '''<summary> '''Represents the connection and commands used to retrieve and save data. '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DataObjectAttribute(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _ ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Partial Public Class tblReservationsTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.OleDb.OleDbDataAdapter Private _connection As Global.System.Data.OleDb.OleDbConnection Private _transaction As Global.System.Data.OleDb.OleDbTransaction Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand Private _clearBeforeFill As Boolean <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.OleDb.OleDbCommand).Connection = value End If i = (i + 1) Loop End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Transaction() As Global.System.Data.OleDb.OleDbTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "tblReservations" tableMapping.ColumnMappings.Add("Seat", "Seat") tableMapping.ColumnMappings.Add("Patron", "Patron") tableMapping.ColumnMappings.Add("Phone", "Phone") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM `tblReservations` WHERE ((`Seat` = ?) AND ((? = 1 AND `Patron` IS NUL"& _ "L) OR (`Patron` = ?)) AND ((? = 1 AND `Phone` IS NULL) OR (`Phone` = ?)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Seat", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Seat", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Patron", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Patron", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Patron", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Patron", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Phone", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Phone", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Phone", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Phone", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO `tblReservations` (`Seat`, `Patron`, `Phone`) VALUES (?, ?, ?)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Seat", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Seat", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Patron", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Patron", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Phone", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Phone", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE `tblReservations` SET `Seat` = ?, `Patron` = ?, `Phone` = ? WHERE ((`Seat`"& _ " = ?) AND ((? = 1 AND `Patron` IS NULL) OR (`Patron` = ?)) AND ((? = 1 AND `Phon"& _ "e` IS NULL) OR (`Phone` = ?)))" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Seat", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Seat", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Patron", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Patron", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Phone", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Phone", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Seat", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Seat", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Patron", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Patron", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Patron", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Patron", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Phone", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Phone", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Phone", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Phone", Global.System.Data.DataRowVersion.Original, false, Nothing)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitConnection() Me._connection = New Global.System.Data.OleDb.OleDbConnection() Me._connection.ConnectionString = Global.Addison_Playhouse_Project.My.MySettings.Default.PlayConnectionString End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT Seat, Patron, Phone FROM tblReservations" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _ Public Overloads Overridable Function Fill(ByVal dataTable As PlayDataSet.tblReservationsDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], true)> _ Public Overloads Overridable Function GetData() As PlayDataSet.tblReservationsDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As PlayDataSet.tblReservationsDataTable = New PlayDataSet.tblReservationsDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataTable As PlayDataSet.tblReservationsDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataSet As PlayDataSet) As Integer Return Me.Adapter.Update(dataSet, "tblReservations") End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ Public Overloads Overridable Function Delete(ByVal Original_Seat As Integer, ByVal Original_Patron As String, ByVal Original_Phone As String) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_Seat,Integer) If (Original_Patron Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_Patron,String) End If If (Original_Phone Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_Phone,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ Public Overloads Overridable Function Insert(ByVal Seat As Integer, ByVal Patron As String, ByVal Phone As String) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(Seat,Integer) If (Patron Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(Patron,String) End If If (Phone Is Nothing) Then Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(2).Value = CType(Phone,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal Seat As Integer, ByVal Patron As String, ByVal Phone As String, ByVal Original_Seat As Integer, ByVal Original_Patron As String, ByVal Original_Phone As String) As Integer Me.Adapter.UpdateCommand.Parameters(0).Value = CType(Seat,Integer) If (Patron Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(Patron,String) End If If (Phone Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Phone,String) End If Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_Seat,Integer) If (Original_Patron Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(4).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(4).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Original_Patron,String) End If If (Original_Phone Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(6).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(6).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = CType(Original_Phone,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal Patron As String, ByVal Phone As String, ByVal Original_Seat As Integer, ByVal Original_Patron As String, ByVal Original_Phone As String) As Integer Return Me.Update(Original_Seat, Patron, Phone, Original_Seat, Original_Patron, Original_Phone) End Function End Class '''<summary> '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD"& _ "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")> _ Partial Public Class TableAdapterManager Inherits Global.System.ComponentModel.Component Private _updateOrder As UpdateOrderOption Private _tblReservationsTableAdapter As tblReservationsTableAdapter Private _backupDataSetBeforeUpdate As Boolean Private _connection As Global.System.Data.IDbConnection <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property UpdateOrder() As UpdateOrderOption Get Return Me._updateOrder End Get Set Me._updateOrder = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _ "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3"& _ "a", "System.Drawing.Design.UITypeEditor")> _ Public Property tblReservationsTableAdapter() As tblReservationsTableAdapter Get Return Me._tblReservationsTableAdapter End Get Set Me._tblReservationsTableAdapter = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property BackupDataSetBeforeUpdate() As Boolean Get Return Me._backupDataSetBeforeUpdate End Get Set Me._backupDataSetBeforeUpdate = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public Property Connection() As Global.System.Data.IDbConnection Get If (Not (Me._connection) Is Nothing) Then Return Me._connection End If If ((Not (Me._tblReservationsTableAdapter) Is Nothing) _ AndAlso (Not (Me._tblReservationsTableAdapter.Connection) Is Nothing)) Then Return Me._tblReservationsTableAdapter.Connection End If Return Nothing End Get Set Me._connection = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property TableAdapterInstanceCount() As Integer Get Dim count As Integer = 0 If (Not (Me._tblReservationsTableAdapter) Is Nothing) Then count = (count + 1) End If Return count End Get End Property '''<summary> '''Update rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateUpdatedRows(ByVal dataSet As PlayDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblReservationsTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.tblReservations.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tblReservationsTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If Return result End Function '''<summary> '''Insert rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateInsertedRows(ByVal dataSet As PlayDataSet, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblReservationsTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.tblReservations.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tblReservationsTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If Return result End Function '''<summary> '''Delete rows in bottom-up order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateDeletedRows(ByVal dataSet As PlayDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblReservationsTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.tblReservations.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tblReservationsTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If Return result End Function '''<summary> '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow() If ((updatedRows Is Nothing) _ OrElse (updatedRows.Length < 1)) Then Return updatedRows End If If ((allAddedRows Is Nothing) _ OrElse (allAddedRows.Count < 1)) Then Return updatedRows End If Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim i As Integer = 0 Do While (i < updatedRows.Length) Dim row As Global.System.Data.DataRow = updatedRows(i) If (allAddedRows.Contains(row) = false) Then realUpdatedRows.Add(row) End If i = (i + 1) Loop Return realUpdatedRows.ToArray End Function '''<summary> '''Update all changes to the dataset. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overridable Function UpdateAll(ByVal dataSet As PlayDataSet) As Integer If (dataSet Is Nothing) Then Throw New Global.System.ArgumentNullException("dataSet") End If If (dataSet.HasChanges = false) Then Return 0 End If If ((Not (Me._tblReservationsTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tblReservationsTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s"& _ "tring.") End If Dim workConnection As Global.System.Data.IDbConnection = Me.Connection If (workConnection Is Nothing) Then Throw New Global.System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana"& _ "ger TableAdapter property to a valid TableAdapter instance.") End If Dim workConnOpened As Boolean = false If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _ = Global.System.Data.ConnectionState.Broken) Then workConnection.Close End If If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then workConnection.Open workConnOpened = true End If Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction If (workTransaction Is Nothing) Then Throw New Global.System.ApplicationException("The transaction cannot begin. The current data connection does not support transa"& _ "ctions or the current state is not allowing the transaction to begin.") End If Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)() Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)() Dim result As Integer = 0 Dim backupDataSet As Global.System.Data.DataSet = Nothing If Me.BackupDataSetBeforeUpdate Then backupDataSet = New Global.System.Data.DataSet() backupDataSet.Merge(dataSet) End If Try '---- Prepare for update ----------- ' If (Not (Me._tblReservationsTableAdapter) Is Nothing) Then revertConnections.Add(Me._tblReservationsTableAdapter, Me._tblReservationsTableAdapter.Connection) Me._tblReservationsTableAdapter.Connection = CType(workConnection,Global.System.Data.OleDb.OleDbConnection) Me._tblReservationsTableAdapter.Transaction = CType(workTransaction,Global.System.Data.OleDb.OleDbTransaction) If Me._tblReservationsTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tblReservationsTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tblReservationsTableAdapter.Adapter) End If End If ' '---- Perform updates ----------- ' If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) Else result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) End If result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows)) ' '---- Commit updates ----------- ' workTransaction.Commit If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If If (0 < allChangedRows.Count) Then Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow allChangedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If Catch ex As Global.System.Exception workTransaction.Rollback '---- Restore the dataset ----------- If Me.BackupDataSetBeforeUpdate Then Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing)) dataSet.Clear dataSet.Merge(backupDataSet) Else If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges row.SetAdded i = (i + 1) Loop End If End If Throw ex Finally If workConnOpened Then workConnection.Close End If If (Not (Me._tblReservationsTableAdapter) Is Nothing) Then Me._tblReservationsTableAdapter.Connection = CType(revertConnections(Me._tblReservationsTableAdapter),Global.System.Data.OleDb.OleDbConnection) Me._tblReservationsTableAdapter.Transaction = Nothing End If If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters) Dim i As Integer = 0 Do While (i < adapters.Length) Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i) adapter.AcceptChangesDuringUpdate = true i = (i + 1) Loop End If End Try Return result End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean If (Not (Me._connection) Is Nothing) Then Return true End If If ((Me.Connection Is Nothing) _ OrElse (inputConnection Is Nothing)) Then Return true End If If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then Return true End If Return false End Function '''<summary> '''Update Order Option '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Enum UpdateOrderOption InsertUpdateDelete = 0 UpdateInsertDelete = 1 End Enum '''<summary> '''Used to sort self-referenced table's rows '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Class SelfReferenceComparer Inherits Object Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow) Private _relation As Global.System.Data.DataRelation Private _childFirst As Integer <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) MyBase.New Me._relation = relation If childFirst Then Me._childFirst = -1 Else Me._childFirst = 1 End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing)) Dim root As Global.System.Data.DataRow = row distance = 0 Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)() traversedRows(row) = row Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Loop If (distance = 0) Then traversedRows.Clear traversedRows(row) = row parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Loop End If Return root End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare If Object.ReferenceEquals(row1, row2) Then Return 0 End If If (row1 Is Nothing) Then Return -1 End If If (row2 Is Nothing) Then Return 1 End If Dim distance1 As Integer = 0 Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1) Dim distance2 As Integer = 0 Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2) If Object.ReferenceEquals(root1, root2) Then Return (Me._childFirst * distance1.CompareTo(distance2)) Else Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _ AndAlso (Not (root2.Table) Is Nothing))) If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then Return -1 Else Return 1 End If End If End Function End Class End Class End Namespace
Chap25/Addison Playhouse Solution/Addison Playhouse Project/PlayDataSet.xsc
Chap25/Addison Playhouse Solution/Addison Playhouse Project/PlayDataSet.xsd
DELETE FROM `tblReservations` WHERE ((`Seat` = ?) AND ((? = 1 AND `Patron` IS NULL) OR (`Patron` = ?)) AND ((? = 1 AND `Phone` IS NULL) OR (`Phone` = ?))) INSERT INTO `tblReservations` (`Seat`, `Patron`, `Phone`) VALUES (?, ?, ?) SELECT Seat, Patron, Phone FROM tblReservations UPDATE `tblReservations` SET `Seat` = ?, `Patron` = ?, `Phone` = ? WHERE ((`Seat` = ?) AND ((? = 1 AND `Patron` IS NULL) OR (`Patron` = ?)) AND ((? = 1 AND `Phone` IS NULL) OR (`Phone` = ?)))
Chap25/Addison Playhouse Solution/Addison Playhouse Project/PlayDataSet.xss
Chap25/Addison Playhouse Solution/Addison Playhouse Solution.sln
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Addison Playhouse Project", "Addison Playhouse Project\Addison Playhouse Project.vbproj", "{8F6BE7CD-9238-4FF3-9570-61794EF9284A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8F6BE7CD-9238-4FF3-9570-61794EF9284A}.Debug|x86.ActiveCfg = Debug|x86 {8F6BE7CD-9238-4FF3-9570-61794EF9284A}.Debug|x86.Build.0 = Debug|x86 {8F6BE7CD-9238-4FF3-9570-61794EF9284A}.Release|x86.ActiveCfg = Release|x86 {8F6BE7CD-9238-4FF3-9570-61794EF9284A}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/Books Solution/Books Project/App.config
Chap25/Books Solution/Books Project/Books Project.vbproj
Debug x86 2.0 {DF33DECA-8B4D-4AF3-8B8F-069E160B30E6} WinExe Books_Project.My.MyApplication Books_Project Books Project 512 WindowsForms v4.5 x86 true full true true bin\Debug\ Books Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false x86 pdbonly false true true bin\Release\ Books Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false On Binary Off On True True BooksDataSet.xsd Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer BooksDataSet.xsd MSDataSetGenerator BooksDataSet.Designer.vb Designer BooksDataSet.xsd MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb Always
Chap25/Books Solution/Books Project/Books.accdb
| BookNumber | Title | Author | Price | QuantityInStock |
|---|---|---|---|---|
| 101 | Garden of Eden | Smith, Leona | ¤ 35.99 | 15 |
| 146 | Rosebud | Smith, Leona | ¤ 24.50 | 20 |
| 224 | Cycle World | Russel, John | ¤ 15.99 | 5 |
| 233 | Motorcycle Mania | Russel, John | ¤ 12.99 | 2 |
| 322 | Truthfully Yours | Staven, Harriet | ¤ 45.50 | 20 |
| 367 | Romance and You | Staven, Harriet | ¤ 10.99 | 15 |
| 401 | My Hero | Smith, Carol | ¤ 63.99 | 23 |
| 402 | Laddie the Dog | Smith, Carol | ¤ 10.99 | 11 |
| 561 | That Was the Day | Handel, Pat | ¤ 15.99 | 4 |
| 581 | Rusty the Robot | Handel, Pat | ¤ 9.99 | 3 |
| 603 | Philomena | Smith, Carol | ¤ 24.50 | 1 |
Chap25/Books Solution/Books Project/BooksDataSet.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On '''<summary> '''Represents a strongly typed in-memory cache of data. '''</summary> <Global.System.Serializable(), _ Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _ Global.System.Xml.Serialization.XmlRootAttribute("BooksDataSet"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _ Partial Public Class BooksDataSet Inherits Global.System.Data.DataSet Private tabletblBooks As tblBooksDataTable Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("tblBooks")) Is Nothing) Then MyBase.Tables.Add(New tblBooksDataTable(ds.Tables("tblBooks"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false), _ Global.System.ComponentModel.DesignerSerializationVisibility(Global.System.ComponentModel.DesignerSerializationVisibility.Content)> _ Public ReadOnly Property tblBooks() As tblBooksDataTable Get Return Me.tabletblBooks End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.BrowsableAttribute(true), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Visible)> _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As BooksDataSet = CType(MyBase.Clone,BooksDataSet) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXml(reader) If (Not (ds.Tables("tblBooks")) Is Nothing) Then MyBase.Tables.Add(New tblBooksDataTable(ds.Tables("tblBooks"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tabletblBooks = CType(MyBase.Tables("tblBooks"),tblBooksDataTable) If (initTable = true) Then If (Not (Me.tabletblBooks) Is Nothing) Then Me.tabletblBooks.InitVars End If End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.DataSetName = "BooksDataSet" Me.Prefix = "" Me.Namespace = "http://tempuri.org/BooksDataSet.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tabletblBooks = New tblBooksDataTable() MyBase.Tables.Add(Me.tabletblBooks) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function ShouldSerializetblBooks() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As BooksDataSet = New BooksDataSet() Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Delegate Sub tblBooksRowChangeEventHandler(ByVal sender As Object, ByVal e As tblBooksRowChangeEvent) '''<summary> '''Represents the strongly named DataTable class. '''</summary> <Global.System.Serializable(), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _ Partial Public Class tblBooksDataTable Inherits Global.System.Data.TypedTableBase(Of tblBooksRow) Private columnBookNumber As Global.System.Data.DataColumn Private columnTitle As Global.System.Data.DataColumn Private columnAuthor As Global.System.Data.DataColumn Private columnPrice As Global.System.Data.DataColumn Private columnQuantityInStock As Global.System.Data.DataColumn <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.TableName = "tblBooks" Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property BookNumberColumn() As Global.System.Data.DataColumn Get Return Me.columnBookNumber End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property TitleColumn() As Global.System.Data.DataColumn Get Return Me.columnTitle End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property AuthorColumn() As Global.System.Data.DataColumn Get Return Me.columnAuthor End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property PriceColumn() As Global.System.Data.DataColumn Get Return Me.columnPrice End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property QuantityInStockColumn() As Global.System.Data.DataColumn Get Return Me.columnQuantityInStock End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Default ReadOnly Property Item(ByVal index As Integer) As tblBooksRow Get Return CType(Me.Rows(index),tblBooksRow) End Get End Property <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBooksRowChanging As tblBooksRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBooksRowChanged As tblBooksRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBooksRowDeleting As tblBooksRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBooksRowDeleted As tblBooksRowChangeEventHandler <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Sub AddtblBooksRow(ByVal row As tblBooksRow) Me.Rows.Add(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Function AddtblBooksRow(ByVal BookNumber As Integer, ByVal Title As String, ByVal Author As String, ByVal Price As Decimal, ByVal QuantityInStock As Integer) As tblBooksRow Dim rowtblBooksRow As tblBooksRow = CType(Me.NewRow,tblBooksRow) Dim columnValuesArray() As Object = New Object() {BookNumber, Title, Author, Price, QuantityInStock} rowtblBooksRow.ItemArray = columnValuesArray Me.Rows.Add(rowtblBooksRow) Return rowtblBooksRow End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function FindByBookNumber(ByVal BookNumber As Integer) As tblBooksRow Return CType(Me.Rows.Find(New Object() {BookNumber}),tblBooksRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As tblBooksDataTable = CType(MyBase.Clone,tblBooksDataTable) cln.InitVars Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New tblBooksDataTable() End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub InitVars() Me.columnBookNumber = MyBase.Columns("BookNumber") Me.columnTitle = MyBase.Columns("Title") Me.columnAuthor = MyBase.Columns("Author") Me.columnPrice = MyBase.Columns("Price") Me.columnQuantityInStock = MyBase.Columns("QuantityInStock") End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.columnBookNumber = New Global.System.Data.DataColumn("BookNumber", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnBookNumber) Me.columnTitle = New Global.System.Data.DataColumn("Title", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnTitle) Me.columnAuthor = New Global.System.Data.DataColumn("Author", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnAuthor) Me.columnPrice = New Global.System.Data.DataColumn("Price", GetType(Decimal), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnPrice) Me.columnQuantityInStock = New Global.System.Data.DataColumn("QuantityInStock", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnQuantityInStock) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnBookNumber}, true)) Me.columnBookNumber.AllowDBNull = false Me.columnBookNumber.Unique = true Me.columnTitle.MaxLength = 50 Me.columnAuthor.MaxLength = 50 End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function NewtblBooksRow() As tblBooksRow Return CType(Me.NewRow,tblBooksRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New tblBooksRow(builder) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(tblBooksRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.tblBooksRowChangedEvent) Is Nothing) Then RaiseEvent tblBooksRowChanged(Me, New tblBooksRowChangeEvent(CType(e.Row,tblBooksRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.tblBooksRowChangingEvent) Is Nothing) Then RaiseEvent tblBooksRowChanging(Me, New tblBooksRowChangeEvent(CType(e.Row,tblBooksRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.tblBooksRowDeletedEvent) Is Nothing) Then RaiseEvent tblBooksRowDeleted(Me, New tblBooksRowChangeEvent(CType(e.Row,tblBooksRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.tblBooksRowDeletingEvent) Is Nothing) Then RaiseEvent tblBooksRowDeleting(Me, New tblBooksRowChangeEvent(CType(e.Row,tblBooksRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub RemovetblBooksRow(ByVal row As tblBooksRow) Me.Rows.Remove(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As BooksDataSet = New BooksDataSet() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "tblBooksDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class '''<summary> '''Represents strongly named DataRow class. '''</summary> Partial Public Class tblBooksRow Inherits Global.System.Data.DataRow Private tabletblBooks As tblBooksDataTable <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tabletblBooks = CType(Me.Table,tblBooksDataTable) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property BookNumber() As Integer Get Return CType(Me(Me.tabletblBooks.BookNumberColumn),Integer) End Get Set Me(Me.tabletblBooks.BookNumberColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Title() As String Get Try Return CType(Me(Me.tabletblBooks.TitleColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Title' in table 'tblBooks' is DBNull.", e) End Try End Get Set Me(Me.tabletblBooks.TitleColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Author() As String Get Try Return CType(Me(Me.tabletblBooks.AuthorColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Author' in table 'tblBooks' is DBNull.", e) End Try End Get Set Me(Me.tabletblBooks.AuthorColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Price() As Decimal Get Try Return CType(Me(Me.tabletblBooks.PriceColumn),Decimal) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Price' in table 'tblBooks' is DBNull.", e) End Try End Get Set Me(Me.tabletblBooks.PriceColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property QuantityInStock() As Integer Get Try Return CType(Me(Me.tabletblBooks.QuantityInStockColumn),Integer) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'QuantityInStock' in table 'tblBooks' is DBNull.", e) End Try End Get Set Me(Me.tabletblBooks.QuantityInStockColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsTitleNull() As Boolean Return Me.IsNull(Me.tabletblBooks.TitleColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetTitleNull() Me(Me.tabletblBooks.TitleColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsAuthorNull() As Boolean Return Me.IsNull(Me.tabletblBooks.AuthorColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetAuthorNull() Me(Me.tabletblBooks.AuthorColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsPriceNull() As Boolean Return Me.IsNull(Me.tabletblBooks.PriceColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetPriceNull() Me(Me.tabletblBooks.PriceColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsQuantityInStockNull() As Boolean Return Me.IsNull(Me.tabletblBooks.QuantityInStockColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetQuantityInStockNull() Me(Me.tabletblBooks.QuantityInStockColumn) = Global.System.Convert.DBNull End Sub End Class '''<summary> '''Row event argument class '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Class tblBooksRowChangeEvent Inherits Global.System.EventArgs Private eventRow As tblBooksRow Private eventAction As Global.System.Data.DataRowAction <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New(ByVal row As tblBooksRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Row() As tblBooksRow Get Return Me.eventRow End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace BooksDataSetTableAdapters '''<summary> '''Represents the connection and commands used to retrieve and save data. '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DataObjectAttribute(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _ ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Partial Public Class tblBooksTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.OleDb.OleDbDataAdapter Private _connection As Global.System.Data.OleDb.OleDbConnection Private _transaction As Global.System.Data.OleDb.OleDbTransaction Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand Private _clearBeforeFill As Boolean <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.OleDb.OleDbCommand).Connection = value End If i = (i + 1) Loop End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Transaction() As Global.System.Data.OleDb.OleDbTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "tblBooks" tableMapping.ColumnMappings.Add("BookNumber", "BookNumber") tableMapping.ColumnMappings.Add("Title", "Title") tableMapping.ColumnMappings.Add("Author", "Author") tableMapping.ColumnMappings.Add("Price", "Price") tableMapping.ColumnMappings.Add("QuantityInStock", "QuantityInStock") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM `tblBooks` WHERE ((`BookNumber` = ?) AND ((? = 1 AND `Title` IS NULL)"& _ " OR (`Title` = ?)) AND ((? = 1 AND `Author` IS NULL) OR (`Author` = ?)) AND ((? "& _ "= 1 AND `Price` IS NULL) OR (`Price` = ?)) AND ((? = 1 AND `QuantityInStock` IS "& _ "NULL) OR (`QuantityInStock` = ?)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_BookNumber", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "BookNumber", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Title", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Title", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Title", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Title", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Author", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Author", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Author", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Author", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_QuantityInStock", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "QuantityInStock", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_QuantityInStock", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "QuantityInStock", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO `tblBooks` (`BookNumber`, `Title`, `Author`, `Price`, `QuantityInStoc"& _ "k`) VALUES (?, ?, ?, ?, ?)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("BookNumber", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "BookNumber", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Title", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Title", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Author", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Author", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("QuantityInStock", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "QuantityInStock", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE `tblBooks` SET `BookNumber` = ?, `Title` = ?, `Author` = ?, `Price` = ?, `"& _ "QuantityInStock` = ? WHERE ((`BookNumber` = ?) AND ((? = 1 AND `Title` IS NULL) "& _ "OR (`Title` = ?)) AND ((? = 1 AND `Author` IS NULL) OR (`Author` = ?)) AND ((? ="& _ " 1 AND `Price` IS NULL) OR (`Price` = ?)) AND ((? = 1 AND `QuantityInStock` IS N"& _ "ULL) OR (`QuantityInStock` = ?)))" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("BookNumber", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "BookNumber", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Title", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Title", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Author", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Author", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("QuantityInStock", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "QuantityInStock", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_BookNumber", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "BookNumber", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Title", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Title", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Title", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Title", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Author", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Author", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Author", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Author", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Price", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Price", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Price", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_QuantityInStock", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "QuantityInStock", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_QuantityInStock", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "QuantityInStock", Global.System.Data.DataRowVersion.Original, false, Nothing)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitConnection() Me._connection = New Global.System.Data.OleDb.OleDbConnection() Me._connection.ConnectionString = Global.Books_Project.My.MySettings.Default.BooksConnectionString End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT BookNumber, Title, Author, Price, QuantityInStock FROM tblBooks" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _ Public Overloads Overridable Function Fill(ByVal dataTable As BooksDataSet.tblBooksDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], true)> _ Public Overloads Overridable Function GetData() As BooksDataSet.tblBooksDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As BooksDataSet.tblBooksDataTable = New BooksDataSet.tblBooksDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataTable As BooksDataSet.tblBooksDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataSet As BooksDataSet) As Integer Return Me.Adapter.Update(dataSet, "tblBooks") End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ Public Overloads Overridable Function Delete(ByVal Original_BookNumber As Integer, ByVal Original_Title As String, ByVal Original_Author As String, ByVal Original_Price As Decimal, ByVal Original_QuantityInStock As Integer) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_BookNumber,Integer) If (Original_Title Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_Title") Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_Title,String) End If If (Original_Author Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_Author") Else Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_Author,String) End If Me.Adapter.DeleteCommand.Parameters(5).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(6).Value = CType(Original_Price,Decimal) Me.Adapter.DeleteCommand.Parameters(7).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(8).Value = CType(Original_QuantityInStock,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ Public Overloads Overridable Function Insert(ByVal BookNumber As Integer, ByVal Title As String, ByVal Author As String, ByVal Price As Decimal, ByVal QuantityInStock As Integer) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(BookNumber,Integer) If (Title Is Nothing) Then Throw New Global.System.ArgumentNullException("Title") Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(Title,String) End If If (Author Is Nothing) Then Throw New Global.System.ArgumentNullException("Author") Else Me.Adapter.InsertCommand.Parameters(2).Value = CType(Author,String) End If Me.Adapter.InsertCommand.Parameters(3).Value = CType(Price,Decimal) Me.Adapter.InsertCommand.Parameters(4).Value = CType(QuantityInStock,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal BookNumber As Integer, ByVal Title As String, ByVal Author As String, ByVal Price As Decimal, ByVal QuantityInStock As Integer, ByVal Original_BookNumber As Integer, ByVal Original_Title As String, ByVal Original_Author As String, ByVal Original_Price As Decimal, ByVal Original_QuantityInStock As Integer) As Integer Me.Adapter.UpdateCommand.Parameters(0).Value = CType(BookNumber,Integer) If (Title Is Nothing) Then Throw New Global.System.ArgumentNullException("Title") Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(Title,String) End If If (Author Is Nothing) Then Throw New Global.System.ArgumentNullException("Author") Else Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Author,String) End If Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Price,Decimal) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(QuantityInStock,Integer) Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Original_BookNumber,Integer) If (Original_Title Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_Title") Else Me.Adapter.UpdateCommand.Parameters(6).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = CType(Original_Title,String) End If If (Original_Author Is Nothing) Then Throw New Global.System.ArgumentNullException("Original_Author") Else Me.Adapter.UpdateCommand.Parameters(8).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(9).Value = CType(Original_Author,String) End If Me.Adapter.UpdateCommand.Parameters(10).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(11).Value = CType(Original_Price,Decimal) Me.Adapter.UpdateCommand.Parameters(12).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(13).Value = CType(Original_QuantityInStock,Integer) Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal Title As String, ByVal Author As String, ByVal Price As Decimal, ByVal QuantityInStock As Integer, ByVal Original_BookNumber As Integer, ByVal Original_Title As String, ByVal Original_Author As String, ByVal Original_Price As Decimal, ByVal Original_QuantityInStock As Integer) As Integer Return Me.Update(Original_BookNumber, Title, Author, Price, QuantityInStock, Original_BookNumber, Original_Title, Original_Author, Original_Price, Original_QuantityInStock) End Function End Class '''<summary> '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD"& _ "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")> _ Partial Public Class TableAdapterManager Inherits Global.System.ComponentModel.Component Private _updateOrder As UpdateOrderOption Private _tblBooksTableAdapter As tblBooksTableAdapter Private _backupDataSetBeforeUpdate As Boolean Private _connection As Global.System.Data.IDbConnection <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property UpdateOrder() As UpdateOrderOption Get Return Me._updateOrder End Get Set Me._updateOrder = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _ "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3"& _ "a", "System.Drawing.Design.UITypeEditor")> _ Public Property tblBooksTableAdapter() As tblBooksTableAdapter Get Return Me._tblBooksTableAdapter End Get Set Me._tblBooksTableAdapter = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property BackupDataSetBeforeUpdate() As Boolean Get Return Me._backupDataSetBeforeUpdate End Get Set Me._backupDataSetBeforeUpdate = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public Property Connection() As Global.System.Data.IDbConnection Get If (Not (Me._connection) Is Nothing) Then Return Me._connection End If If ((Not (Me._tblBooksTableAdapter) Is Nothing) _ AndAlso (Not (Me._tblBooksTableAdapter.Connection) Is Nothing)) Then Return Me._tblBooksTableAdapter.Connection End If Return Nothing End Get Set Me._connection = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property TableAdapterInstanceCount() As Integer Get Dim count As Integer = 0 If (Not (Me._tblBooksTableAdapter) Is Nothing) Then count = (count + 1) End If Return count End Get End Property '''<summary> '''Update rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateUpdatedRows(ByVal dataSet As BooksDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblBooksTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.tblBooks.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tblBooksTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If Return result End Function '''<summary> '''Insert rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateInsertedRows(ByVal dataSet As BooksDataSet, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblBooksTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.tblBooks.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tblBooksTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If Return result End Function '''<summary> '''Delete rows in bottom-up order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateDeletedRows(ByVal dataSet As BooksDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblBooksTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.tblBooks.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tblBooksTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If Return result End Function '''<summary> '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow() If ((updatedRows Is Nothing) _ OrElse (updatedRows.Length < 1)) Then Return updatedRows End If If ((allAddedRows Is Nothing) _ OrElse (allAddedRows.Count < 1)) Then Return updatedRows End If Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim i As Integer = 0 Do While (i < updatedRows.Length) Dim row As Global.System.Data.DataRow = updatedRows(i) If (allAddedRows.Contains(row) = false) Then realUpdatedRows.Add(row) End If i = (i + 1) Loop Return realUpdatedRows.ToArray End Function '''<summary> '''Update all changes to the dataset. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overridable Function UpdateAll(ByVal dataSet As BooksDataSet) As Integer If (dataSet Is Nothing) Then Throw New Global.System.ArgumentNullException("dataSet") End If If (dataSet.HasChanges = false) Then Return 0 End If If ((Not (Me._tblBooksTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tblBooksTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s"& _ "tring.") End If Dim workConnection As Global.System.Data.IDbConnection = Me.Connection If (workConnection Is Nothing) Then Throw New Global.System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana"& _ "ger TableAdapter property to a valid TableAdapter instance.") End If Dim workConnOpened As Boolean = false If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _ = Global.System.Data.ConnectionState.Broken) Then workConnection.Close End If If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then workConnection.Open workConnOpened = true End If Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction If (workTransaction Is Nothing) Then Throw New Global.System.ApplicationException("The transaction cannot begin. The current data connection does not support transa"& _ "ctions or the current state is not allowing the transaction to begin.") End If Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)() Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)() Dim result As Integer = 0 Dim backupDataSet As Global.System.Data.DataSet = Nothing If Me.BackupDataSetBeforeUpdate Then backupDataSet = New Global.System.Data.DataSet() backupDataSet.Merge(dataSet) End If Try '---- Prepare for update ----------- ' If (Not (Me._tblBooksTableAdapter) Is Nothing) Then revertConnections.Add(Me._tblBooksTableAdapter, Me._tblBooksTableAdapter.Connection) Me._tblBooksTableAdapter.Connection = CType(workConnection,Global.System.Data.OleDb.OleDbConnection) Me._tblBooksTableAdapter.Transaction = CType(workTransaction,Global.System.Data.OleDb.OleDbTransaction) If Me._tblBooksTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tblBooksTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tblBooksTableAdapter.Adapter) End If End If ' '---- Perform updates ----------- ' If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) Else result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) End If result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows)) ' '---- Commit updates ----------- ' workTransaction.Commit If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If If (0 < allChangedRows.Count) Then Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow allChangedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If Catch ex As Global.System.Exception workTransaction.Rollback '---- Restore the dataset ----------- If Me.BackupDataSetBeforeUpdate Then Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing)) dataSet.Clear dataSet.Merge(backupDataSet) Else If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges row.SetAdded i = (i + 1) Loop End If End If Throw ex Finally If workConnOpened Then workConnection.Close End If If (Not (Me._tblBooksTableAdapter) Is Nothing) Then Me._tblBooksTableAdapter.Connection = CType(revertConnections(Me._tblBooksTableAdapter),Global.System.Data.OleDb.OleDbConnection) Me._tblBooksTableAdapter.Transaction = Nothing End If If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters) Dim i As Integer = 0 Do While (i < adapters.Length) Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i) adapter.AcceptChangesDuringUpdate = true i = (i + 1) Loop End If End Try Return result End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean If (Not (Me._connection) Is Nothing) Then Return true End If If ((Me.Connection Is Nothing) _ OrElse (inputConnection Is Nothing)) Then Return true End If If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then Return true End If Return false End Function '''<summary> '''Update Order Option '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Enum UpdateOrderOption InsertUpdateDelete = 0 UpdateInsertDelete = 1 End Enum '''<summary> '''Used to sort self-referenced table's rows '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Class SelfReferenceComparer Inherits Object Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow) Private _relation As Global.System.Data.DataRelation Private _childFirst As Integer <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) MyBase.New Me._relation = relation If childFirst Then Me._childFirst = -1 Else Me._childFirst = 1 End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing)) Dim root As Global.System.Data.DataRow = row distance = 0 Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)() traversedRows(row) = row Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Loop If (distance = 0) Then traversedRows.Clear traversedRows(row) = row parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Loop End If Return root End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare If Object.ReferenceEquals(row1, row2) Then Return 0 End If If (row1 Is Nothing) Then Return -1 End If If (row2 Is Nothing) Then Return 1 End If Dim distance1 As Integer = 0 Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1) Dim distance2 As Integer = 0 Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2) If Object.ReferenceEquals(root1, root2) Then Return (Me._childFirst * distance1.CompareTo(distance2)) Else Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _ AndAlso (Not (root2.Table) Is Nothing))) If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then Return -1 Else Return 1 End If End If End Function End Class End Class End Namespace
Chap25/Books Solution/Books Project/BooksDataSet.xsc
Chap25/Books Solution/Books Project/BooksDataSet.xsd
DELETE FROM `tblBooks` WHERE ((`BookNumber` = ?) AND ((? = 1 AND `Title` IS NULL) OR (`Title` = ?)) AND ((? = 1 AND `Author` IS NULL) OR (`Author` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)) AND ((? = 1 AND `QuantityInStock` IS NULL) OR (`QuantityInStock` = ?))) INSERT INTO `tblBooks` (`BookNumber`, `Title`, `Author`, `Price`, `QuantityInStock`) VALUES (?, ?, ?, ?, ?) SELECT BookNumber, Title, Author, Price, QuantityInStock FROM tblBooks UPDATE `tblBooks` SET `BookNumber` = ?, `Title` = ?, `Author` = ?, `Price` = ?, `QuantityInStock` = ? WHERE ((`BookNumber` = ?) AND ((? = 1 AND `Title` IS NULL) OR (`Title` = ?)) AND ((? = 1 AND `Author` IS NULL) OR (`Author` = ?)) AND ((? = 1 AND `Price` IS NULL) OR (`Price` = ?)) AND ((? = 1 AND `QuantityInStock` IS NULL) OR (`QuantityInStock` = ?)))
Chap25/Books Solution/Books Project/BooksDataSet.xss
Chap25/Books Solution/Books Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.BooksDataSet = New Books_Project.BooksDataSet() Me.TblBooksBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TblBooksTableAdapter = New Books_Project.BooksDataSetTableAdapters.tblBooksTableAdapter() Me.TableAdapterManager = New Books_Project.BooksDataSetTableAdapters.TableAdapterManager() Me.TblBooksDataGridView = New System.Windows.Forms.DataGridView() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn5 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.btnCalc = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() CType(Me.BooksDataSet, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblBooksBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblBooksDataGridView, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'BooksDataSet ' Me.BooksDataSet.DataSetName = "BooksDataSet" Me.BooksDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' 'TblBooksBindingSource ' Me.TblBooksBindingSource.DataMember = "tblBooks" Me.TblBooksBindingSource.DataSource = Me.BooksDataSet ' 'TblBooksTableAdapter ' Me.TblBooksTableAdapter.ClearBeforeFill = True ' 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.tblBooksTableAdapter = Me.TblBooksTableAdapter Me.TableAdapterManager.UpdateOrder = Books_Project.BooksDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'TblBooksDataGridView ' Me.TblBooksDataGridView.AllowUserToAddRows = False Me.TblBooksDataGridView.AllowUserToDeleteRows = False Me.TblBooksDataGridView.AutoGenerateColumns = False Me.TblBooksDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.TblBooksDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.TblBooksDataGridView.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3, Me.DataGridViewTextBoxColumn4, Me.DataGridViewTextBoxColumn5}) Me.TblBooksDataGridView.DataSource = Me.TblBooksBindingSource Me.TblBooksDataGridView.Dock = System.Windows.Forms.DockStyle.Top Me.TblBooksDataGridView.Location = New System.Drawing.Point(0, 0) Me.TblBooksDataGridView.Name = "TblBooksDataGridView" Me.TblBooksDataGridView.ReadOnly = True Me.TblBooksDataGridView.RowHeadersVisible = False Me.TblBooksDataGridView.Size = New System.Drawing.Size(443, 280) Me.TblBooksDataGridView.TabIndex = 2 ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn1.DataPropertyName = "BookNumber" Me.DataGridViewTextBoxColumn1.HeaderText = "Number" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 81 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells Me.DataGridViewTextBoxColumn2.DataPropertyName = "Title" Me.DataGridViewTextBoxColumn2.HeaderText = "Title" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True Me.DataGridViewTextBoxColumn2.Width = 57 ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells Me.DataGridViewTextBoxColumn3.DataPropertyName = "Author" Me.DataGridViewTextBoxColumn3.HeaderText = "Author" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True Me.DataGridViewTextBoxColumn3.Width = 72 ' 'DataGridViewTextBoxColumn4 ' Me.DataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn4.DataPropertyName = "Price" DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle1.Format = "N2" DataGridViewCellStyle1.NullValue = Nothing Me.DataGridViewTextBoxColumn4.DefaultCellStyle = DataGridViewCellStyle1 Me.DataGridViewTextBoxColumn4.HeaderText = "Price" Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4" Me.DataGridViewTextBoxColumn4.ReadOnly = True Me.DataGridViewTextBoxColumn4.Width = 61 ' 'DataGridViewTextBoxColumn5 ' Me.DataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn5.DataPropertyName = "QuantityInStock" DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight Me.DataGridViewTextBoxColumn5.DefaultCellStyle = DataGridViewCellStyle2 Me.DataGridViewTextBoxColumn5.HeaderText = "Quantity" Me.DataGridViewTextBoxColumn5.Name = "DataGridViewTextBoxColumn5" Me.DataGridViewTextBoxColumn5.ReadOnly = True Me.DataGridViewTextBoxColumn5.Width = 81 ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(189, 302) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(161, 30) Me.btnCalc.TabIndex = 0 Me.btnCalc.Text = "&Calculate Total Value" Me.btnCalc.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(356, 302) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 30) Me.btnExit.TabIndex = 1 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(443, 350) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.TblBooksDataGridView) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Bookstore Haven" CType(Me.BooksDataSet, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblBooksBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblBooksDataGridView, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents BooksDataSet As Books_Project.BooksDataSet Friend WithEvents TblBooksBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TblBooksTableAdapter As Books_Project.BooksDataSetTableAdapters.tblBooksTableAdapter Friend WithEvents TableAdapterManager As Books_Project.BooksDataSetTableAdapters.TableAdapterManager Friend WithEvents TblBooksDataGridView As System.Windows.Forms.DataGridView Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn4 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn5 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents btnCalc As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button End Class
Chap25/Books Solution/Books Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 144, 17 324, 17 498, 17 True True True True
Chap25/Books Solution/Books Project/frmMain.vb
' Name: Books Project ' Purpose: Displays the records in the dataset and ' the total value of the inventory ' Programmer: <your name> on <current date> Public Class frmMain Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'BooksDataSet.tblBooks' table. You can move, or remove it, as needed. Me.TblBooksTableAdapter.Fill(Me.BooksDataSet.tblBooks) End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class
Chap25/Books Solution/Books Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Books_Project.frmMain End Sub End Class End Namespace
Chap25/Books Solution/Books Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap25/Books Solution/Books Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Books Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Microsoft")> <Assembly: AssemblyProduct("Books Project")> <Assembly: AssemblyCopyright("Copyright © Microsoft 2011")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("0fb5be98-cb7e-4956-9a83-44a41517dc5c")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap25/Books Solution/Books Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Books_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
Chap25/Books Solution/Books Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap25/Books Solution/Books Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18033 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Books.accdb")> _ Public ReadOnly Property BooksConnectionString() As String Get Return CType(Me("BooksConnectionString"),String) End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Books_Project.My.MySettings Get Return Global.Books_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap25/Books Solution/Books Project/My Project/Settings.settings
<?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Books.accdb</ConnectionString> <ProviderName>System.Data.OleDb</ProviderName> </SerializableConnectionString> Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Books.accdb
Chap25/Books Solution/Books Solution.sln
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Books Project", "Books Project\Books Project.vbproj", "{DF33DECA-8B4D-4AF3-8B8F-069E160B30E6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {DF33DECA-8B4D-4AF3-8B8F-069E160B30E6}.Debug|x86.ActiveCfg = Debug|x86 {DF33DECA-8B4D-4AF3-8B8F-069E160B30E6}.Debug|x86.Build.0 = Debug|x86 {DF33DECA-8B4D-4AF3-8B8F-069E160B30E6}.Release|x86.ActiveCfg = Release|x86 {DF33DECA-8B4D-4AF3-8B8F-069E160B30E6}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/College Courses Solution/College Courses Project/App.config
Chap25/College Courses Solution/College Courses Project/College Courses Project.vbproj
Debug AnyCPU {E17CA76A-99D8-44E3-BFCB-6E068AB3C022} WinExe College_Courses_Project.My.MyApplication College_Courses_Project College Courses Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ College Courses Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ College Courses Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb
Chap25/College Courses Solution/College Courses Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.btnDisplay = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.btnPrevious = New System.Windows.Forms.Button() Me.btnNext = New System.Windows.Forms.Button() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.btnCalc = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'btnDisplay ' Me.btnDisplay.Location = New System.Drawing.Point(275, 379) Me.btnDisplay.Name = "btnDisplay" Me.btnDisplay.Size = New System.Drawing.Size(129, 34) Me.btnDisplay.TabIndex = 3 Me.btnDisplay.Text = "&Display by Grade" Me.btnDisplay.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(529, 379) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 34) Me.btnExit.TabIndex = 5 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'btnPrevious ' Me.btnPrevious.Location = New System.Drawing.Point(140, 379) Me.btnPrevious.Name = "btnPrevious" Me.btnPrevious.Size = New System.Drawing.Size(129, 34) Me.btnPrevious.TabIndex = 2 Me.btnPrevious.Text = "&Previous Record" Me.btnPrevious.UseVisualStyleBackColor = True ' 'btnNext ' Me.btnNext.Location = New System.Drawing.Point(27, 379) Me.btnNext.Name = "btnNext" Me.btnNext.Size = New System.Drawing.Size(107, 34) Me.btnNext.TabIndex = 1 Me.btnNext.Text = "&Next Record" Me.btnNext.UseVisualStyleBackColor = True ' 'GroupBox1 ' Me.GroupBox1.Location = New System.Drawing.Point(24, 25) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(577, 284) Me.GroupBox1.TabIndex = 0 Me.GroupBox1.TabStop = False ' 'btnCalc ' Me.btnCalc.Location = New System.Drawing.Point(410, 379) Me.btnCalc.Name = "btnCalc" Me.btnCalc.Size = New System.Drawing.Size(110, 34) Me.btnCalc.TabIndex = 4 Me.btnCalc.Text = "&Calculate GPA" Me.btnCalc.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(638, 452) Me.Controls.Add(Me.btnCalc) Me.Controls.Add(Me.btnDisplay) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnPrevious) Me.Controls.Add(Me.btnNext) Me.Controls.Add(Me.GroupBox1) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "College Courses" Me.ResumeLayout(False) End Sub Friend WithEvents btnDisplay As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnPrevious As System.Windows.Forms.Button Friend WithEvents btnNext As System.Windows.Forms.Button Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents btnCalc As System.Windows.Forms.Button End Class
Chap25/College Courses Solution/College Courses Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True True True True
Chap25/College Courses Solution/College Courses Project/frmMain.vb
' Name: College Courses Project ' Purpose: Display the contents of a dataset ' Allow the user to display the records for a specific grade ' Allow the user to display the GPA ' Programmer: <your name> on <current date> Public Class frmMain Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class
Chap25/College Courses Solution/College Courses Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.College_Courses_Project.frmMain End Sub End Class End Namespace
Chap25/College Courses Solution/College Courses Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap25/College Courses Solution/College Courses Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("College Courses Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("College Courses Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("5fb0c1ec-4747-4d60-8efe-afd9019cdd91")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap25/College Courses Solution/College Courses Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("College_Courses_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
Chap25/College Courses Solution/College Courses Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap25/College Courses Solution/College Courses Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Courses.accdb")> _ Public ReadOnly Property CoursesConnectionString() As String Get Return CType(Me("CoursesConnectionString"),String) End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.College_Courses_Project.My.MySettings Get Return Global.College_Courses_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap25/College Courses Solution/College Courses Project/My Project/Settings.settings
Chap25/College Courses Solution/College Courses Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "College Courses Project", "College Courses Project\College Courses Project.vbproj", "{E17CA76A-99D8-44E3-BFCB-6E068AB3C022}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E17CA76A-99D8-44E3-BFCB-6E068AB3C022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E17CA76A-99D8-44E3-BFCB-6E068AB3C022}.Debug|Any CPU.Build.0 = Debug|Any CPU {E17CA76A-99D8-44E3-BFCB-6E068AB3C022}.Release|Any CPU.ActiveCfg = Release|Any CPU {E17CA76A-99D8-44E3-BFCB-6E068AB3C022}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/Courses.accdb
| ID | Title | CreditHours | Grade |
|---|---|---|---|
| CS100 | Introduction to Computers | 3 | A |
| CS106 | Windows Seminar | 2 | B |
| CS204 | Visual Basic | 3 | B |
| EN100 | English Composition | 3 | A |
| EN104 | Speech | 2 | B |
| HS100 | History | 3 | C |
| PE100 | Health | 2 | F |
| PE101 | Golf | 2 | A |
| PS100 | Political Science | 3 | D |
| SO100 | Sociology | 3 | C |
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/App.config
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.btnAll = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.btnName = New System.Windows.Forms.Button() Me.btnCode = New System.Windows.Forms.Button() Me.MagazinesDataSet = New Magazine_Project.MagazinesDataSet() Me.TblMagazineBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TblMagazineTableAdapter = New Magazine_Project.MagazinesDataSetTableAdapters.tblMagazineTableAdapter() Me.TableAdapterManager = New Magazine_Project.MagazinesDataSetTableAdapters.TableAdapterManager() Me.TblMagazineDataGridView = New System.Windows.Forms.DataGridView() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() CType(Me.MagazinesDataSet, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblMagazineBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblMagazineDataGridView, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'btnAll ' Me.btnAll.Location = New System.Drawing.Point(312, 94) Me.btnAll.Name = "btnAll" Me.btnAll.Size = New System.Drawing.Size(159, 35) Me.btnAll.TabIndex = 2 Me.btnAll.Text = "&All Records" Me.btnAll.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(312, 135) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(159, 35) Me.btnExit.TabIndex = 3 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'btnName ' Me.btnName.Location = New System.Drawing.Point(312, 53) Me.btnName.Name = "btnName" Me.btnName.Size = New System.Drawing.Size(159, 35) Me.btnName.TabIndex = 1 Me.btnName.Text = "&Visual Basic Record" Me.btnName.UseVisualStyleBackColor = True ' 'btnCode ' Me.btnCode.Location = New System.Drawing.Point(312, 12) Me.btnCode.Name = "btnCode" Me.btnCode.Size = New System.Drawing.Size(159, 35) Me.btnCode.TabIndex = 0 Me.btnCode.Text = "&Code EX33" Me.btnCode.UseVisualStyleBackColor = True ' 'MagazinesDataSet ' Me.MagazinesDataSet.DataSetName = "MagazinesDataSet" Me.MagazinesDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' 'TblMagazineBindingSource ' Me.TblMagazineBindingSource.DataMember = "tblMagazine" Me.TblMagazineBindingSource.DataSource = Me.MagazinesDataSet ' 'TblMagazineTableAdapter ' Me.TblMagazineTableAdapter.ClearBeforeFill = True ' 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.tblMagazineTableAdapter = Me.TblMagazineTableAdapter Me.TableAdapterManager.UpdateOrder = Magazine_Project.MagazinesDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'TblMagazineDataGridView ' Me.TblMagazineDataGridView.AllowUserToAddRows = False Me.TblMagazineDataGridView.AllowUserToDeleteRows = False Me.TblMagazineDataGridView.AutoGenerateColumns = False Me.TblMagazineDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.TblMagazineDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.TblMagazineDataGridView.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3}) Me.TblMagazineDataGridView.DataSource = Me.TblMagazineBindingSource Me.TblMagazineDataGridView.Location = New System.Drawing.Point(12, 12) Me.TblMagazineDataGridView.Name = "TblMagazineDataGridView" Me.TblMagazineDataGridView.ReadOnly = True Me.TblMagazineDataGridView.RowHeadersVisible = False Me.TblMagazineDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.TblMagazineDataGridView.Size = New System.Drawing.Size(271, 250) Me.TblMagazineDataGridView.TabIndex = 4 ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn1.DataPropertyName = "Code" Me.DataGridViewTextBoxColumn1.HeaderText = "Code" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 64 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.DataPropertyName = "MagName" Me.DataGridViewTextBoxColumn2.HeaderText = "MagName" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn3.DataPropertyName = "Cost" DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle1.Format = "N2" DataGridViewCellStyle1.NullValue = Nothing Me.DataGridViewTextBoxColumn3.DefaultCellStyle = DataGridViewCellStyle1 Me.DataGridViewTextBoxColumn3.HeaderText = "Cost" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True Me.DataGridViewTextBoxColumn3.Width = 59 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(501, 303) Me.Controls.Add(Me.TblMagazineDataGridView) Me.Controls.Add(Me.btnAll) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnName) Me.Controls.Add(Me.btnCode) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Magazines" CType(Me.MagazinesDataSet, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblMagazineBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblMagazineDataGridView, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents btnAll As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnName As System.Windows.Forms.Button Friend WithEvents btnCode As System.Windows.Forms.Button Friend WithEvents MagazinesDataSet As Magazine_Project.MagazinesDataSet Friend WithEvents TblMagazineBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TblMagazineTableAdapter As Magazine_Project.MagazinesDataSetTableAdapters.tblMagazineTableAdapter Friend WithEvents TableAdapterManager As Magazine_Project.MagazinesDataSetTableAdapters.TableAdapterManager Friend WithEvents TblMagazineDataGridView As System.Windows.Forms.DataGridView Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn End Class
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True 17, 17 169, 17 369, 17 17, 56 True True
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/frmMain.vb
' Name: Magazine Project ' Purpose: Demonstrate using LINQ to select records ' Programmer: <your name> on <current date> Public Class frmMain Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'MagazinesDataSet.tblMagazine' table. You can move, or remove it, as needed. Me.TblMagazineTableAdapter.Fill(Me.MagazinesDataSet.tblMagazine) End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnCode_Click(sender As Object, e As EventArgs) Handles btnCode.Click ' display record whose Code field contains EX33 End Sub Private Sub btnName_Click(sender As Object, e As EventArgs) Handles btnName.Click ' display Visual Basic record End Sub Private Sub btnAll_Click(sender As Object, e As EventArgs) Handles btnAll.Click ' display all records End Sub End Class
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/Magazine Project.vbproj
Debug x86 2.0 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD} WinExe Magazine_Project.My.MyApplication Magazine_Project Magazine Project 512 WindowsForms v4.5 x86 true full true true bin\Debug\ Magazine Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false x86 pdbonly false true true bin\Release\ Magazine Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false On Binary Off On Form frmMain.vb Form True True MagazinesDataSet.xsd True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MagazinesDataSet.xsd MSDataSetGenerator MagazinesDataSet.Designer.vb Designer MagazinesDataSet.xsd MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb Always
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/Magazines.accdb
| MagName | Cost | Code |
|---|---|---|
| Beautiful You | ¤ 4.00 | HE45 |
| Fit and Fun | ¤ 3.00 | EX33 |
| Visual Basic | ¤ 5.00 | PG24 |
| C Sharp | ¤ 3.50 | PG45 |
| Light Cooking | ¤ 2.50 | HE91 |
| Gardening Days | ¤ 3.00 | OU36 |
| Planting Roses | ¤ 6.00 | OU29 |
| C++ | ¤ 4.50 | PG10 |
| Java | ¤ 3.75 | PG15 |
| Country MD | ¤ 8.00 | HE25 |
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/MagazinesDataSet.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On '''<summary> '''Represents a strongly typed in-memory cache of data. '''</summary> <Global.System.Serializable(), _ Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _ Global.System.Xml.Serialization.XmlRootAttribute("MagazinesDataSet"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _ Partial Public Class MagazinesDataSet Inherits Global.System.Data.DataSet Private tabletblMagazine As tblMagazineDataTable Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("tblMagazine")) Is Nothing) Then MyBase.Tables.Add(New tblMagazineDataTable(ds.Tables("tblMagazine"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false), _ Global.System.ComponentModel.DesignerSerializationVisibility(Global.System.ComponentModel.DesignerSerializationVisibility.Content)> _ Public ReadOnly Property tblMagazine() As tblMagazineDataTable Get Return Me.tabletblMagazine End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.BrowsableAttribute(true), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Visible)> _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As MagazinesDataSet = CType(MyBase.Clone,MagazinesDataSet) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXml(reader) If (Not (ds.Tables("tblMagazine")) Is Nothing) Then MyBase.Tables.Add(New tblMagazineDataTable(ds.Tables("tblMagazine"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tabletblMagazine = CType(MyBase.Tables("tblMagazine"),tblMagazineDataTable) If (initTable = true) Then If (Not (Me.tabletblMagazine) Is Nothing) Then Me.tabletblMagazine.InitVars End If End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.DataSetName = "MagazinesDataSet" Me.Prefix = "" Me.Namespace = "http://tempuri.org/MagazinesDataSet.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tabletblMagazine = New tblMagazineDataTable() MyBase.Tables.Add(Me.tabletblMagazine) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function ShouldSerializetblMagazine() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As MagazinesDataSet = New MagazinesDataSet() Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Delegate Sub tblMagazineRowChangeEventHandler(ByVal sender As Object, ByVal e As tblMagazineRowChangeEvent) '''<summary> '''Represents the strongly named DataTable class. '''</summary> <Global.System.Serializable(), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _ Partial Public Class tblMagazineDataTable Inherits Global.System.Data.TypedTableBase(Of tblMagazineRow) Private columnCode As Global.System.Data.DataColumn Private columnMagName As Global.System.Data.DataColumn Private columnCost As Global.System.Data.DataColumn <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.TableName = "tblMagazine" Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property CodeColumn() As Global.System.Data.DataColumn Get Return Me.columnCode End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property MagNameColumn() As Global.System.Data.DataColumn Get Return Me.columnMagName End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property CostColumn() As Global.System.Data.DataColumn Get Return Me.columnCost End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Default ReadOnly Property Item(ByVal index As Integer) As tblMagazineRow Get Return CType(Me.Rows(index),tblMagazineRow) End Get End Property <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowChanging As tblMagazineRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowChanged As tblMagazineRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowDeleting As tblMagazineRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowDeleted As tblMagazineRowChangeEventHandler <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Sub AddtblMagazineRow(ByVal row As tblMagazineRow) Me.Rows.Add(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Function AddtblMagazineRow(ByVal Code As String, ByVal MagName As String, ByVal Cost As Decimal) As tblMagazineRow Dim rowtblMagazineRow As tblMagazineRow = CType(Me.NewRow,tblMagazineRow) Dim columnValuesArray() As Object = New Object() {Code, MagName, Cost} rowtblMagazineRow.ItemArray = columnValuesArray Me.Rows.Add(rowtblMagazineRow) Return rowtblMagazineRow End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function FindByCode(ByVal Code As String) As tblMagazineRow Return CType(Me.Rows.Find(New Object() {Code}),tblMagazineRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As tblMagazineDataTable = CType(MyBase.Clone,tblMagazineDataTable) cln.InitVars Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New tblMagazineDataTable() End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub InitVars() Me.columnCode = MyBase.Columns("Code") Me.columnMagName = MyBase.Columns("MagName") Me.columnCost = MyBase.Columns("Cost") End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.columnCode = New Global.System.Data.DataColumn("Code", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCode) Me.columnMagName = New Global.System.Data.DataColumn("MagName", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnMagName) Me.columnCost = New Global.System.Data.DataColumn("Cost", GetType(Decimal), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCost) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnCode}, true)) Me.columnCode.AllowDBNull = false Me.columnCode.Unique = true Me.columnCode.MaxLength = 255 Me.columnMagName.MaxLength = 255 End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function NewtblMagazineRow() As tblMagazineRow Return CType(Me.NewRow,tblMagazineRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New tblMagazineRow(builder) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(tblMagazineRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.tblMagazineRowChangedEvent) Is Nothing) Then RaiseEvent tblMagazineRowChanged(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.tblMagazineRowChangingEvent) Is Nothing) Then RaiseEvent tblMagazineRowChanging(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.tblMagazineRowDeletedEvent) Is Nothing) Then RaiseEvent tblMagazineRowDeleted(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.tblMagazineRowDeletingEvent) Is Nothing) Then RaiseEvent tblMagazineRowDeleting(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub RemovetblMagazineRow(ByVal row As tblMagazineRow) Me.Rows.Remove(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As MagazinesDataSet = New MagazinesDataSet() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "tblMagazineDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class '''<summary> '''Represents strongly named DataRow class. '''</summary> Partial Public Class tblMagazineRow Inherits Global.System.Data.DataRow Private tabletblMagazine As tblMagazineDataTable <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tabletblMagazine = CType(Me.Table,tblMagazineDataTable) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Code() As String Get Return CType(Me(Me.tabletblMagazine.CodeColumn),String) End Get Set Me(Me.tabletblMagazine.CodeColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property MagName() As String Get Try Return CType(Me(Me.tabletblMagazine.MagNameColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'MagName' in table 'tblMagazine' is DBNull.", e) End Try End Get Set Me(Me.tabletblMagazine.MagNameColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Cost() As Decimal Get Try Return CType(Me(Me.tabletblMagazine.CostColumn),Decimal) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Cost' in table 'tblMagazine' is DBNull.", e) End Try End Get Set Me(Me.tabletblMagazine.CostColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsMagNameNull() As Boolean Return Me.IsNull(Me.tabletblMagazine.MagNameColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetMagNameNull() Me(Me.tabletblMagazine.MagNameColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsCostNull() As Boolean Return Me.IsNull(Me.tabletblMagazine.CostColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetCostNull() Me(Me.tabletblMagazine.CostColumn) = Global.System.Convert.DBNull End Sub End Class '''<summary> '''Row event argument class '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Class tblMagazineRowChangeEvent Inherits Global.System.EventArgs Private eventRow As tblMagazineRow Private eventAction As Global.System.Data.DataRowAction <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New(ByVal row As tblMagazineRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Row() As tblMagazineRow Get Return Me.eventRow End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace MagazinesDataSetTableAdapters '''<summary> '''Represents the connection and commands used to retrieve and save data. '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DataObjectAttribute(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _ ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Partial Public Class tblMagazineTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.OleDb.OleDbDataAdapter Private _connection As Global.System.Data.OleDb.OleDbConnection Private _transaction As Global.System.Data.OleDb.OleDbTransaction Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand Private _clearBeforeFill As Boolean <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.OleDb.OleDbCommand).Connection = value End If i = (i + 1) Loop End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Transaction() As Global.System.Data.OleDb.OleDbTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "tblMagazine" tableMapping.ColumnMappings.Add("Code", "Code") tableMapping.ColumnMappings.Add("MagName", "MagName") tableMapping.ColumnMappings.Add("Cost", "Cost") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM `tblMagazine` WHERE ((`Code` = ?) AND ((? = 1 AND `MagName` IS NULL) "& _ "OR (`MagName` = ?)) AND ((? = 1 AND `Cost` IS NULL) OR (`Cost` = ?)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MagName", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Cost", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO `tblMagazine` (`Code`, `MagName`, `Cost`) VALUES (?, ?, ?)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE `tblMagazine` SET `Code` = ?, `MagName` = ?, `Cost` = ? WHERE ((`Code` = ?"& _ ") AND ((? = 1 AND `MagName` IS NULL) OR (`MagName` = ?)) AND ((? = 1 AND `Cost` "& _ "IS NULL) OR (`Cost` = ?)))" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MagName", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Cost", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, false, Nothing)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitConnection() Me._connection = New Global.System.Data.OleDb.OleDbConnection() Me._connection.ConnectionString = Global.Magazine_Project.My.MySettings.Default.MagazinesConnectionString End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT Code, MagName, Cost FROM tblMagazine" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _ Public Overloads Overridable Function Fill(ByVal dataTable As MagazinesDataSet.tblMagazineDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], true)> _ Public Overloads Overridable Function GetData() As MagazinesDataSet.tblMagazineDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As MagazinesDataSet.tblMagazineDataTable = New MagazinesDataSet.tblMagazineDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataTable As MagazinesDataSet.tblMagazineDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataSet As MagazinesDataSet) As Integer Return Me.Adapter.Update(dataSet, "tblMagazine") End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ Public Overloads Overridable Function Delete(ByVal Original_Code As String, ByVal Original_MagName As String, ByVal Original_Cost As Global.System.Nullable(Of Decimal)) As Integer If (Original_Code Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_Code,String) End If If (Original_MagName Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_MagName,String) End If If (Original_Cost.HasValue = true) Then Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_Cost.Value,Decimal) Else Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ Public Overloads Overridable Function Insert(ByVal Code As String, ByVal MagName As String, ByVal Cost As Global.System.Nullable(Of Decimal)) As Integer If (Code Is Nothing) Then Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(Code,String) End If If (MagName Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(MagName,String) End If If (Cost.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(2).Value = CType(Cost.Value,Decimal) Else Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal Code As String, ByVal MagName As String, ByVal Cost As Global.System.Nullable(Of Decimal), ByVal Original_Code As String, ByVal Original_MagName As String, ByVal Original_Cost As Global.System.Nullable(Of Decimal)) As Integer If (Code Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(Code,String) End If If (MagName Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(MagName,String) End If If (Cost.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Cost.Value,Decimal) Else Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value End If If (Original_Code Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_Code,String) End If If (Original_MagName Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(4).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(4).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Original_MagName,String) End If If (Original_Cost.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(6).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = CType(Original_Cost.Value,Decimal) Else Me.Adapter.UpdateCommand.Parameters(6).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal MagName As String, ByVal Cost As Global.System.Nullable(Of Decimal), ByVal Original_Code As String, ByVal Original_MagName As String, ByVal Original_Cost As Global.System.Nullable(Of Decimal)) As Integer Return Me.Update(Original_Code, MagName, Cost, Original_Code, Original_MagName, Original_Cost) End Function End Class '''<summary> '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD"& _ "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")> _ Partial Public Class TableAdapterManager Inherits Global.System.ComponentModel.Component Private _updateOrder As UpdateOrderOption Private _tblMagazineTableAdapter As tblMagazineTableAdapter Private _backupDataSetBeforeUpdate As Boolean Private _connection As Global.System.Data.IDbConnection <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property UpdateOrder() As UpdateOrderOption Get Return Me._updateOrder End Get Set Me._updateOrder = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _ "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3"& _ "a", "System.Drawing.Design.UITypeEditor")> _ Public Property tblMagazineTableAdapter() As tblMagazineTableAdapter Get Return Me._tblMagazineTableAdapter End Get Set Me._tblMagazineTableAdapter = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property BackupDataSetBeforeUpdate() As Boolean Get Return Me._backupDataSetBeforeUpdate End Get Set Me._backupDataSetBeforeUpdate = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public Property Connection() As Global.System.Data.IDbConnection Get If (Not (Me._connection) Is Nothing) Then Return Me._connection End If If ((Not (Me._tblMagazineTableAdapter) Is Nothing) _ AndAlso (Not (Me._tblMagazineTableAdapter.Connection) Is Nothing)) Then Return Me._tblMagazineTableAdapter.Connection End If Return Nothing End Get Set Me._connection = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property TableAdapterInstanceCount() As Integer Get Dim count As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then count = (count + 1) End If Return count End Get End Property '''<summary> '''Update rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateUpdatedRows(ByVal dataSet As MagazinesDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.tblMagazine.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tblMagazineTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If Return result End Function '''<summary> '''Insert rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateInsertedRows(ByVal dataSet As MagazinesDataSet, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.tblMagazine.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tblMagazineTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If Return result End Function '''<summary> '''Delete rows in bottom-up order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateDeletedRows(ByVal dataSet As MagazinesDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.tblMagazine.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tblMagazineTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If Return result End Function '''<summary> '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow() If ((updatedRows Is Nothing) _ OrElse (updatedRows.Length < 1)) Then Return updatedRows End If If ((allAddedRows Is Nothing) _ OrElse (allAddedRows.Count < 1)) Then Return updatedRows End If Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim i As Integer = 0 Do While (i < updatedRows.Length) Dim row As Global.System.Data.DataRow = updatedRows(i) If (allAddedRows.Contains(row) = false) Then realUpdatedRows.Add(row) End If i = (i + 1) Loop Return realUpdatedRows.ToArray End Function '''<summary> '''Update all changes to the dataset. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overridable Function UpdateAll(ByVal dataSet As MagazinesDataSet) As Integer If (dataSet Is Nothing) Then Throw New Global.System.ArgumentNullException("dataSet") End If If (dataSet.HasChanges = false) Then Return 0 End If If ((Not (Me._tblMagazineTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tblMagazineTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s"& _ "tring.") End If Dim workConnection As Global.System.Data.IDbConnection = Me.Connection If (workConnection Is Nothing) Then Throw New Global.System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana"& _ "ger TableAdapter property to a valid TableAdapter instance.") End If Dim workConnOpened As Boolean = false If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _ = Global.System.Data.ConnectionState.Broken) Then workConnection.Close End If If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then workConnection.Open workConnOpened = true End If Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction If (workTransaction Is Nothing) Then Throw New Global.System.ApplicationException("The transaction cannot begin. The current data connection does not support transa"& _ "ctions or the current state is not allowing the transaction to begin.") End If Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)() Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)() Dim result As Integer = 0 Dim backupDataSet As Global.System.Data.DataSet = Nothing If Me.BackupDataSetBeforeUpdate Then backupDataSet = New Global.System.Data.DataSet() backupDataSet.Merge(dataSet) End If Try '---- Prepare for update ----------- ' If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then revertConnections.Add(Me._tblMagazineTableAdapter, Me._tblMagazineTableAdapter.Connection) Me._tblMagazineTableAdapter.Connection = CType(workConnection,Global.System.Data.OleDb.OleDbConnection) Me._tblMagazineTableAdapter.Transaction = CType(workTransaction,Global.System.Data.OleDb.OleDbTransaction) If Me._tblMagazineTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tblMagazineTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tblMagazineTableAdapter.Adapter) End If End If ' '---- Perform updates ----------- ' If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) Else result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) End If result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows)) ' '---- Commit updates ----------- ' workTransaction.Commit If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If If (0 < allChangedRows.Count) Then Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow allChangedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If Catch ex As Global.System.Exception workTransaction.Rollback '---- Restore the dataset ----------- If Me.BackupDataSetBeforeUpdate Then Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing)) dataSet.Clear dataSet.Merge(backupDataSet) Else If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges row.SetAdded i = (i + 1) Loop End If End If Throw ex Finally If workConnOpened Then workConnection.Close End If If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Me._tblMagazineTableAdapter.Connection = CType(revertConnections(Me._tblMagazineTableAdapter),Global.System.Data.OleDb.OleDbConnection) Me._tblMagazineTableAdapter.Transaction = Nothing End If If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters) Dim i As Integer = 0 Do While (i < adapters.Length) Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i) adapter.AcceptChangesDuringUpdate = true i = (i + 1) Loop End If End Try Return result End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean If (Not (Me._connection) Is Nothing) Then Return true End If If ((Me.Connection Is Nothing) _ OrElse (inputConnection Is Nothing)) Then Return true End If If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then Return true End If Return false End Function '''<summary> '''Update Order Option '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Enum UpdateOrderOption InsertUpdateDelete = 0 UpdateInsertDelete = 1 End Enum '''<summary> '''Used to sort self-referenced table's rows '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Class SelfReferenceComparer Inherits Object Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow) Private _relation As Global.System.Data.DataRelation Private _childFirst As Integer <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) MyBase.New Me._relation = relation If childFirst Then Me._childFirst = -1 Else Me._childFirst = 1 End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing)) Dim root As Global.System.Data.DataRow = row distance = 0 Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)() traversedRows(row) = row Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Loop If (distance = 0) Then traversedRows.Clear traversedRows(row) = row parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Loop End If Return root End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare If Object.ReferenceEquals(row1, row2) Then Return 0 End If If (row1 Is Nothing) Then Return -1 End If If (row2 Is Nothing) Then Return 1 End If Dim distance1 As Integer = 0 Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1) Dim distance2 As Integer = 0 Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2) If Object.ReferenceEquals(root1, root2) Then Return (Me._childFirst * distance1.CompareTo(distance2)) Else Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _ AndAlso (Not (root2.Table) Is Nothing))) If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then Return -1 Else Return 1 End If End If End Function End Class End Class End Namespace
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/MagazinesDataSet.xsc
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/MagazinesDataSet.xsd
DELETE FROM `tblMagazine` WHERE ((`Code` = ?) AND ((? = 1 AND `MagName` IS NULL) OR (`MagName` = ?)) AND ((? = 1 AND `Cost` IS NULL) OR (`Cost` = ?))) INSERT INTO `tblMagazine` (`Code`, `MagName`, `Cost`) VALUES (?, ?, ?) SELECT Code, MagName, Cost FROM tblMagazine UPDATE `tblMagazine` SET `Code` = ?, `MagName` = ?, `Cost` = ? WHERE ((`Code` = ?) AND ((? = 1 AND `MagName` IS NULL) OR (`MagName` = ?)) AND ((? = 1 AND `Cost` IS NULL) OR (`Cost` = ?)))
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/MagazinesDataSet.xss
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Magazine_Project.frmMain End Sub End Class End Namespace
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Magazine Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Microsoft")> <Assembly: AssemblyProduct("Magazine Project")> <Assembly: AssemblyCopyright("Copyright © Microsoft 2011")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("606c7d7e-f909-4df7-853f-eb668b8df754")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Magazine_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Magazines.accdb")> _ Public ReadOnly Property MagazinesConnectionString() As String Get Return CType(Me("MagazinesConnectionString"),String) End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Magazine_Project.My.MySettings Get Return Global.Magazine_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap25/Magazine Solution-TRY THIS 1/Magazine Project/My Project/Settings.settings
<?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Magazines.accdb</ConnectionString> <ProviderName>System.Data.OleDb</ProviderName> </SerializableConnectionString> Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Magazines.accdb
Chap25/Magazine Solution-TRY THIS 1/Magazine Solution.sln
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Magazine Project", "Magazine Project\Magazine Project.vbproj", "{1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Debug|x86.ActiveCfg = Debug|x86 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Debug|x86.Build.0 = Debug|x86 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Release|x86.ActiveCfg = Release|x86 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/App.config
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.btnAverage = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.btnName = New System.Windows.Forms.Button() Me.btnCost = New System.Windows.Forms.Button() Me.MagazinesDataSet = New Magazine_Project.MagazinesDataSet() Me.TblMagazineBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TblMagazineTableAdapter = New Magazine_Project.MagazinesDataSetTableAdapters.tblMagazineTableAdapter() Me.TableAdapterManager = New Magazine_Project.MagazinesDataSetTableAdapters.TableAdapterManager() Me.TblMagazineDataGridView = New System.Windows.Forms.DataGridView() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.btnAll = New System.Windows.Forms.Button() CType(Me.MagazinesDataSet, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblMagazineBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblMagazineDataGridView, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'btnAverage ' Me.btnAverage.Location = New System.Drawing.Point(312, 135) Me.btnAverage.Name = "btnAverage" Me.btnAverage.Size = New System.Drawing.Size(214, 35) Me.btnAverage.TabIndex = 3 Me.btnAverage.Text = "&Display Average Cost" Me.btnAverage.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(312, 176) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(214, 35) Me.btnExit.TabIndex = 4 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'btnName ' Me.btnName.Location = New System.Drawing.Point(312, 94) Me.btnName.Name = "btnName" Me.btnName.Size = New System.Drawing.Size(214, 35) Me.btnName.TabIndex = 2 Me.btnName.Text = "Display &Names Beginning with C" Me.btnName.UseVisualStyleBackColor = True ' 'btnCost ' Me.btnCost.Location = New System.Drawing.Point(312, 53) Me.btnCost.Name = "btnCost" Me.btnCost.Size = New System.Drawing.Size(214, 35) Me.btnCost.TabIndex = 1 Me.btnCost.Text = "Display &Cost of at Least $4" Me.btnCost.UseVisualStyleBackColor = True ' 'MagazinesDataSet ' Me.MagazinesDataSet.DataSetName = "MagazinesDataSet" Me.MagazinesDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' 'TblMagazineBindingSource ' Me.TblMagazineBindingSource.DataMember = "tblMagazine" Me.TblMagazineBindingSource.DataSource = Me.MagazinesDataSet ' 'TblMagazineTableAdapter ' Me.TblMagazineTableAdapter.ClearBeforeFill = True ' 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.tblMagazineTableAdapter = Me.TblMagazineTableAdapter Me.TableAdapterManager.UpdateOrder = Magazine_Project.MagazinesDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'TblMagazineDataGridView ' Me.TblMagazineDataGridView.AllowUserToAddRows = False Me.TblMagazineDataGridView.AllowUserToDeleteRows = False Me.TblMagazineDataGridView.AutoGenerateColumns = False Me.TblMagazineDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.TblMagazineDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.TblMagazineDataGridView.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3}) Me.TblMagazineDataGridView.DataSource = Me.TblMagazineBindingSource Me.TblMagazineDataGridView.Location = New System.Drawing.Point(12, 12) Me.TblMagazineDataGridView.Name = "TblMagazineDataGridView" Me.TblMagazineDataGridView.ReadOnly = True Me.TblMagazineDataGridView.RowHeadersVisible = False Me.TblMagazineDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.TblMagazineDataGridView.Size = New System.Drawing.Size(271, 250) Me.TblMagazineDataGridView.TabIndex = 5 ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn1.DataPropertyName = "Code" Me.DataGridViewTextBoxColumn1.HeaderText = "Code" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 64 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.DataPropertyName = "MagName" Me.DataGridViewTextBoxColumn2.HeaderText = "MagName" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn3.DataPropertyName = "Cost" DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle1.Format = "N2" DataGridViewCellStyle1.NullValue = Nothing Me.DataGridViewTextBoxColumn3.DefaultCellStyle = DataGridViewCellStyle1 Me.DataGridViewTextBoxColumn3.HeaderText = "Cost" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True Me.DataGridViewTextBoxColumn3.Width = 59 ' 'btnAll ' Me.btnAll.Location = New System.Drawing.Point(312, 12) Me.btnAll.Name = "btnAll" Me.btnAll.Size = New System.Drawing.Size(214, 35) Me.btnAll.TabIndex = 0 Me.btnAll.Text = "Display &All Records" Me.btnAll.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(544, 303) Me.Controls.Add(Me.btnAll) Me.Controls.Add(Me.TblMagazineDataGridView) Me.Controls.Add(Me.btnAverage) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnName) Me.Controls.Add(Me.btnCost) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Magazines" CType(Me.MagazinesDataSet, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblMagazineBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblMagazineDataGridView, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents btnAverage As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnName As System.Windows.Forms.Button Friend WithEvents btnCost As System.Windows.Forms.Button Friend WithEvents MagazinesDataSet As Magazine_Project.MagazinesDataSet Friend WithEvents TblMagazineBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TblMagazineTableAdapter As Magazine_Project.MagazinesDataSetTableAdapters.tblMagazineTableAdapter Friend WithEvents TableAdapterManager As Magazine_Project.MagazinesDataSetTableAdapters.TableAdapterManager Friend WithEvents TblMagazineDataGridView As System.Windows.Forms.DataGridView Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents btnAll As System.Windows.Forms.Button End Class
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 True True True True 17, 17 169, 17 369, 17 17, 56 True True True
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/frmMain.vb
' Name: Magazine Project ' Purpose: Demonstrate using LINQ to select records ' Programmer: <your name> on <current date> Public Class frmMain Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'MagazinesDataSet.tblMagazine' table. You can move, or remove it, as needed. Me.TblMagazineTableAdapter.Fill(Me.MagazinesDataSet.tblMagazine) End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnAll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAll.Click ' displays all records End Sub Private Sub btnCost_Click(sender As Object, e As EventArgs) Handles btnCost.Click ' displays records having a cost of at least $4 End Sub Private Sub btnName_Click(sender As Object, e As EventArgs) Handles btnName.Click ' displays records whose names begin with C End Sub Private Sub btnAverage_Click(sender As Object, e As EventArgs) Handles btnAverage.Click ' displays average cost End Sub End Class
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/Magazine Project.vbproj
Debug x86 2.0 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD} WinExe Magazine_Project.My.MyApplication Magazine_Project Magazine Project 512 WindowsForms v4.5 x86 true full true true bin\Debug\ Magazine Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false x86 pdbonly false true true bin\Release\ Magazine Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 false On Binary Off On Form frmMain.vb Form True True MagazinesDataSet.xsd True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MagazinesDataSet.xsd MSDataSetGenerator MagazinesDataSet.Designer.vb Designer MagazinesDataSet.xsd MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb Always
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/Magazines.accdb
| MagName | Cost | Code |
|---|---|---|
| Beautiful You | ¤ 4.00 | HE45 |
| Fit and Fun | ¤ 3.00 | EX33 |
| Visual Basic | ¤ 5.00 | PG24 |
| C Sharp | ¤ 3.50 | PG45 |
| Light Cooking | ¤ 2.50 | HE91 |
| Gardening Days | ¤ 3.00 | OU36 |
| Planting Roses | ¤ 6.00 | OU29 |
| C++ | ¤ 4.50 | PG10 |
| Java | ¤ 3.75 | PG15 |
| Country MD | ¤ 8.00 | HE25 |
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/MagazinesDataSet.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On '''<summary> '''Represents a strongly typed in-memory cache of data. '''</summary> <Global.System.Serializable(), _ Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _ Global.System.Xml.Serialization.XmlRootAttribute("MagazinesDataSet"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _ Partial Public Class MagazinesDataSet Inherits Global.System.Data.DataSet Private tabletblMagazine As tblMagazineDataTable Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("tblMagazine")) Is Nothing) Then MyBase.Tables.Add(New tblMagazineDataTable(ds.Tables("tblMagazine"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false), _ Global.System.ComponentModel.DesignerSerializationVisibility(Global.System.ComponentModel.DesignerSerializationVisibility.Content)> _ Public ReadOnly Property tblMagazine() As tblMagazineDataTable Get Return Me.tabletblMagazine End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.BrowsableAttribute(true), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Visible)> _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As MagazinesDataSet = CType(MyBase.Clone,MagazinesDataSet) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXml(reader) If (Not (ds.Tables("tblMagazine")) Is Nothing) Then MyBase.Tables.Add(New tblMagazineDataTable(ds.Tables("tblMagazine"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tabletblMagazine = CType(MyBase.Tables("tblMagazine"),tblMagazineDataTable) If (initTable = true) Then If (Not (Me.tabletblMagazine) Is Nothing) Then Me.tabletblMagazine.InitVars End If End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.DataSetName = "MagazinesDataSet" Me.Prefix = "" Me.Namespace = "http://tempuri.org/MagazinesDataSet.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tabletblMagazine = New tblMagazineDataTable() MyBase.Tables.Add(Me.tabletblMagazine) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function ShouldSerializetblMagazine() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As MagazinesDataSet = New MagazinesDataSet() Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Delegate Sub tblMagazineRowChangeEventHandler(ByVal sender As Object, ByVal e As tblMagazineRowChangeEvent) '''<summary> '''Represents the strongly named DataTable class. '''</summary> <Global.System.Serializable(), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _ Partial Public Class tblMagazineDataTable Inherits Global.System.Data.TypedTableBase(Of tblMagazineRow) Private columnCode As Global.System.Data.DataColumn Private columnMagName As Global.System.Data.DataColumn Private columnCost As Global.System.Data.DataColumn <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.TableName = "tblMagazine" Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property CodeColumn() As Global.System.Data.DataColumn Get Return Me.columnCode End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property MagNameColumn() As Global.System.Data.DataColumn Get Return Me.columnMagName End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property CostColumn() As Global.System.Data.DataColumn Get Return Me.columnCost End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Default ReadOnly Property Item(ByVal index As Integer) As tblMagazineRow Get Return CType(Me.Rows(index),tblMagazineRow) End Get End Property <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowChanging As tblMagazineRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowChanged As tblMagazineRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowDeleting As tblMagazineRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblMagazineRowDeleted As tblMagazineRowChangeEventHandler <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Sub AddtblMagazineRow(ByVal row As tblMagazineRow) Me.Rows.Add(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Function AddtblMagazineRow(ByVal Code As String, ByVal MagName As String, ByVal Cost As Decimal) As tblMagazineRow Dim rowtblMagazineRow As tblMagazineRow = CType(Me.NewRow,tblMagazineRow) Dim columnValuesArray() As Object = New Object() {Code, MagName, Cost} rowtblMagazineRow.ItemArray = columnValuesArray Me.Rows.Add(rowtblMagazineRow) Return rowtblMagazineRow End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function FindByCode(ByVal Code As String) As tblMagazineRow Return CType(Me.Rows.Find(New Object() {Code}),tblMagazineRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As tblMagazineDataTable = CType(MyBase.Clone,tblMagazineDataTable) cln.InitVars Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New tblMagazineDataTable() End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub InitVars() Me.columnCode = MyBase.Columns("Code") Me.columnMagName = MyBase.Columns("MagName") Me.columnCost = MyBase.Columns("Cost") End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.columnCode = New Global.System.Data.DataColumn("Code", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCode) Me.columnMagName = New Global.System.Data.DataColumn("MagName", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnMagName) Me.columnCost = New Global.System.Data.DataColumn("Cost", GetType(Decimal), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnCost) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnCode}, true)) Me.columnCode.AllowDBNull = false Me.columnCode.Unique = true Me.columnCode.MaxLength = 255 Me.columnMagName.MaxLength = 255 End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function NewtblMagazineRow() As tblMagazineRow Return CType(Me.NewRow,tblMagazineRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New tblMagazineRow(builder) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(tblMagazineRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.tblMagazineRowChangedEvent) Is Nothing) Then RaiseEvent tblMagazineRowChanged(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.tblMagazineRowChangingEvent) Is Nothing) Then RaiseEvent tblMagazineRowChanging(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.tblMagazineRowDeletedEvent) Is Nothing) Then RaiseEvent tblMagazineRowDeleted(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.tblMagazineRowDeletingEvent) Is Nothing) Then RaiseEvent tblMagazineRowDeleting(Me, New tblMagazineRowChangeEvent(CType(e.Row,tblMagazineRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub RemovetblMagazineRow(ByVal row As tblMagazineRow) Me.Rows.Remove(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As MagazinesDataSet = New MagazinesDataSet() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "tblMagazineDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class '''<summary> '''Represents strongly named DataRow class. '''</summary> Partial Public Class tblMagazineRow Inherits Global.System.Data.DataRow Private tabletblMagazine As tblMagazineDataTable <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tabletblMagazine = CType(Me.Table,tblMagazineDataTable) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Code() As String Get Return CType(Me(Me.tabletblMagazine.CodeColumn),String) End Get Set Me(Me.tabletblMagazine.CodeColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property MagName() As String Get Try Return CType(Me(Me.tabletblMagazine.MagNameColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'MagName' in table 'tblMagazine' is DBNull.", e) End Try End Get Set Me(Me.tabletblMagazine.MagNameColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Cost() As Decimal Get Try Return CType(Me(Me.tabletblMagazine.CostColumn),Decimal) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Cost' in table 'tblMagazine' is DBNull.", e) End Try End Get Set Me(Me.tabletblMagazine.CostColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsMagNameNull() As Boolean Return Me.IsNull(Me.tabletblMagazine.MagNameColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetMagNameNull() Me(Me.tabletblMagazine.MagNameColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsCostNull() As Boolean Return Me.IsNull(Me.tabletblMagazine.CostColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetCostNull() Me(Me.tabletblMagazine.CostColumn) = Global.System.Convert.DBNull End Sub End Class '''<summary> '''Row event argument class '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Class tblMagazineRowChangeEvent Inherits Global.System.EventArgs Private eventRow As tblMagazineRow Private eventAction As Global.System.Data.DataRowAction <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New(ByVal row As tblMagazineRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Row() As tblMagazineRow Get Return Me.eventRow End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace MagazinesDataSetTableAdapters '''<summary> '''Represents the connection and commands used to retrieve and save data. '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DataObjectAttribute(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _ ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Partial Public Class tblMagazineTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.OleDb.OleDbDataAdapter Private _connection As Global.System.Data.OleDb.OleDbConnection Private _transaction As Global.System.Data.OleDb.OleDbTransaction Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand Private _clearBeforeFill As Boolean <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.OleDb.OleDbCommand).Connection = value End If i = (i + 1) Loop End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Transaction() As Global.System.Data.OleDb.OleDbTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "tblMagazine" tableMapping.ColumnMappings.Add("Code", "Code") tableMapping.ColumnMappings.Add("MagName", "MagName") tableMapping.ColumnMappings.Add("Cost", "Cost") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM `tblMagazine` WHERE ((`Code` = ?) AND ((? = 1 AND `MagName` IS NULL) "& _ "OR (`MagName` = ?)) AND ((? = 1 AND `Cost` IS NULL) OR (`Cost` = ?)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MagName", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Cost", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO `tblMagazine` (`Code`, `MagName`, `Cost`) VALUES (?, ?, ?)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE `tblMagazine` SET `Code` = ?, `MagName` = ?, `Cost` = ? WHERE ((`Code` = ?"& _ ") AND ((? = 1 AND `MagName` IS NULL) OR (`MagName` = ?)) AND ((? = 1 AND `Cost` "& _ "IS NULL) OR (`Cost` = ?)))" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Code", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Code", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_MagName", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_MagName", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "MagName", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Cost", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Cost", Global.System.Data.OleDb.OleDbType.Currency, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Cost", Global.System.Data.DataRowVersion.Original, false, Nothing)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitConnection() Me._connection = New Global.System.Data.OleDb.OleDbConnection() Me._connection.ConnectionString = Global.Magazine_Project.My.MySettings.Default.MagazinesConnectionString End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT Code, MagName, Cost FROM tblMagazine" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _ Public Overloads Overridable Function Fill(ByVal dataTable As MagazinesDataSet.tblMagazineDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], true)> _ Public Overloads Overridable Function GetData() As MagazinesDataSet.tblMagazineDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As MagazinesDataSet.tblMagazineDataTable = New MagazinesDataSet.tblMagazineDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataTable As MagazinesDataSet.tblMagazineDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataSet As MagazinesDataSet) As Integer Return Me.Adapter.Update(dataSet, "tblMagazine") End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ Public Overloads Overridable Function Delete(ByVal Original_Code As String, ByVal Original_MagName As String, ByVal Original_Cost As Global.System.Nullable(Of Decimal)) As Integer If (Original_Code Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_Code,String) End If If (Original_MagName Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_MagName,String) End If If (Original_Cost.HasValue = true) Then Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_Cost.Value,Decimal) Else Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ Public Overloads Overridable Function Insert(ByVal Code As String, ByVal MagName As String, ByVal Cost As Global.System.Nullable(Of Decimal)) As Integer If (Code Is Nothing) Then Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(Code,String) End If If (MagName Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(MagName,String) End If If (Cost.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(2).Value = CType(Cost.Value,Decimal) Else Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal Code As String, ByVal MagName As String, ByVal Cost As Global.System.Nullable(Of Decimal), ByVal Original_Code As String, ByVal Original_MagName As String, ByVal Original_Cost As Global.System.Nullable(Of Decimal)) As Integer If (Code Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(Code,String) End If If (MagName Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(MagName,String) End If If (Cost.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Cost.Value,Decimal) Else Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value End If If (Original_Code Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_Code,String) End If If (Original_MagName Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(4).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(5).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(4).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(5).Value = CType(Original_MagName,String) End If If (Original_Cost.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(6).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = CType(Original_Cost.Value,Decimal) Else Me.Adapter.UpdateCommand.Parameters(6).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(7).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal MagName As String, ByVal Cost As Global.System.Nullable(Of Decimal), ByVal Original_Code As String, ByVal Original_MagName As String, ByVal Original_Cost As Global.System.Nullable(Of Decimal)) As Integer Return Me.Update(Original_Code, MagName, Cost, Original_Code, Original_MagName, Original_Cost) End Function End Class '''<summary> '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD"& _ "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")> _ Partial Public Class TableAdapterManager Inherits Global.System.ComponentModel.Component Private _updateOrder As UpdateOrderOption Private _tblMagazineTableAdapter As tblMagazineTableAdapter Private _backupDataSetBeforeUpdate As Boolean Private _connection As Global.System.Data.IDbConnection <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property UpdateOrder() As UpdateOrderOption Get Return Me._updateOrder End Get Set Me._updateOrder = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _ "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3"& _ "a", "System.Drawing.Design.UITypeEditor")> _ Public Property tblMagazineTableAdapter() As tblMagazineTableAdapter Get Return Me._tblMagazineTableAdapter End Get Set Me._tblMagazineTableAdapter = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property BackupDataSetBeforeUpdate() As Boolean Get Return Me._backupDataSetBeforeUpdate End Get Set Me._backupDataSetBeforeUpdate = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public Property Connection() As Global.System.Data.IDbConnection Get If (Not (Me._connection) Is Nothing) Then Return Me._connection End If If ((Not (Me._tblMagazineTableAdapter) Is Nothing) _ AndAlso (Not (Me._tblMagazineTableAdapter.Connection) Is Nothing)) Then Return Me._tblMagazineTableAdapter.Connection End If Return Nothing End Get Set Me._connection = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property TableAdapterInstanceCount() As Integer Get Dim count As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then count = (count + 1) End If Return count End Get End Property '''<summary> '''Update rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateUpdatedRows(ByVal dataSet As MagazinesDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.tblMagazine.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tblMagazineTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If Return result End Function '''<summary> '''Insert rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateInsertedRows(ByVal dataSet As MagazinesDataSet, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.tblMagazine.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tblMagazineTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If Return result End Function '''<summary> '''Delete rows in bottom-up order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateDeletedRows(ByVal dataSet As MagazinesDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.tblMagazine.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tblMagazineTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If Return result End Function '''<summary> '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow() If ((updatedRows Is Nothing) _ OrElse (updatedRows.Length < 1)) Then Return updatedRows End If If ((allAddedRows Is Nothing) _ OrElse (allAddedRows.Count < 1)) Then Return updatedRows End If Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim i As Integer = 0 Do While (i < updatedRows.Length) Dim row As Global.System.Data.DataRow = updatedRows(i) If (allAddedRows.Contains(row) = false) Then realUpdatedRows.Add(row) End If i = (i + 1) Loop Return realUpdatedRows.ToArray End Function '''<summary> '''Update all changes to the dataset. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overridable Function UpdateAll(ByVal dataSet As MagazinesDataSet) As Integer If (dataSet Is Nothing) Then Throw New Global.System.ArgumentNullException("dataSet") End If If (dataSet.HasChanges = false) Then Return 0 End If If ((Not (Me._tblMagazineTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tblMagazineTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s"& _ "tring.") End If Dim workConnection As Global.System.Data.IDbConnection = Me.Connection If (workConnection Is Nothing) Then Throw New Global.System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana"& _ "ger TableAdapter property to a valid TableAdapter instance.") End If Dim workConnOpened As Boolean = false If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _ = Global.System.Data.ConnectionState.Broken) Then workConnection.Close End If If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then workConnection.Open workConnOpened = true End If Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction If (workTransaction Is Nothing) Then Throw New Global.System.ApplicationException("The transaction cannot begin. The current data connection does not support transa"& _ "ctions or the current state is not allowing the transaction to begin.") End If Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)() Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)() Dim result As Integer = 0 Dim backupDataSet As Global.System.Data.DataSet = Nothing If Me.BackupDataSetBeforeUpdate Then backupDataSet = New Global.System.Data.DataSet() backupDataSet.Merge(dataSet) End If Try '---- Prepare for update ----------- ' If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then revertConnections.Add(Me._tblMagazineTableAdapter, Me._tblMagazineTableAdapter.Connection) Me._tblMagazineTableAdapter.Connection = CType(workConnection,Global.System.Data.OleDb.OleDbConnection) Me._tblMagazineTableAdapter.Transaction = CType(workTransaction,Global.System.Data.OleDb.OleDbTransaction) If Me._tblMagazineTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tblMagazineTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tblMagazineTableAdapter.Adapter) End If End If ' '---- Perform updates ----------- ' If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) Else result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) End If result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows)) ' '---- Commit updates ----------- ' workTransaction.Commit If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If If (0 < allChangedRows.Count) Then Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow allChangedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If Catch ex As Global.System.Exception workTransaction.Rollback '---- Restore the dataset ----------- If Me.BackupDataSetBeforeUpdate Then Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing)) dataSet.Clear dataSet.Merge(backupDataSet) Else If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges row.SetAdded i = (i + 1) Loop End If End If Throw ex Finally If workConnOpened Then workConnection.Close End If If (Not (Me._tblMagazineTableAdapter) Is Nothing) Then Me._tblMagazineTableAdapter.Connection = CType(revertConnections(Me._tblMagazineTableAdapter),Global.System.Data.OleDb.OleDbConnection) Me._tblMagazineTableAdapter.Transaction = Nothing End If If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters) Dim i As Integer = 0 Do While (i < adapters.Length) Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i) adapter.AcceptChangesDuringUpdate = true i = (i + 1) Loop End If End Try Return result End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean If (Not (Me._connection) Is Nothing) Then Return true End If If ((Me.Connection Is Nothing) _ OrElse (inputConnection Is Nothing)) Then Return true End If If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then Return true End If Return false End Function '''<summary> '''Update Order Option '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Enum UpdateOrderOption InsertUpdateDelete = 0 UpdateInsertDelete = 1 End Enum '''<summary> '''Used to sort self-referenced table's rows '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Class SelfReferenceComparer Inherits Object Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow) Private _relation As Global.System.Data.DataRelation Private _childFirst As Integer <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) MyBase.New Me._relation = relation If childFirst Then Me._childFirst = -1 Else Me._childFirst = 1 End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing)) Dim root As Global.System.Data.DataRow = row distance = 0 Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)() traversedRows(row) = row Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Loop If (distance = 0) Then traversedRows.Clear traversedRows(row) = row parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Loop End If Return root End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare If Object.ReferenceEquals(row1, row2) Then Return 0 End If If (row1 Is Nothing) Then Return -1 End If If (row2 Is Nothing) Then Return 1 End If Dim distance1 As Integer = 0 Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1) Dim distance2 As Integer = 0 Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2) If Object.ReferenceEquals(root1, root2) Then Return (Me._childFirst * distance1.CompareTo(distance2)) Else Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _ AndAlso (Not (root2.Table) Is Nothing))) If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then Return -1 Else Return 1 End If End If End Function End Class End Class End Namespace
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/MagazinesDataSet.xsc
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/MagazinesDataSet.xsd
DELETE FROM `tblMagazine` WHERE ((`Code` = ?) AND ((? = 1 AND `MagName` IS NULL) OR (`MagName` = ?)) AND ((? = 1 AND `Cost` IS NULL) OR (`Cost` = ?))) INSERT INTO `tblMagazine` (`Code`, `MagName`, `Cost`) VALUES (?, ?, ?) SELECT Code, MagName, Cost FROM tblMagazine UPDATE `tblMagazine` SET `Code` = ?, `MagName` = ?, `Cost` = ? WHERE ((`Code` = ?) AND ((? = 1 AND `MagName` IS NULL) OR (`MagName` = ?)) AND ((? = 1 AND `Cost` IS NULL) OR (`Cost` = ?)))
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/MagazinesDataSet.xss
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.Magazine_Project.frmMain End Sub End Class End Namespace
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("Magazine Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("Microsoft")> <Assembly: AssemblyProduct("Magazine Project")> <Assembly: AssemblyCopyright("Copyright © Microsoft 2011")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("606c7d7e-f909-4df7-853f-eb668b8df754")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Imports System Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Magazine_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set resourceCulture = value End Set End Property End Module End Namespace
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Magazines.accdb")> _ Public ReadOnly Property MagazinesConnectionString() As String Get Return CType(Me("MagazinesConnectionString"),String) End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Magazine_Project.My.MySettings Get Return Global.Magazine_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap25/Magazine Solution-TRY THIS 2/Magazine Project/My Project/Settings.settings
<?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Magazines.accdb</ConnectionString> <ProviderName>System.Data.OleDb</ProviderName> </SerializableConnectionString> Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Magazines.accdb
Chap25/Magazine Solution-TRY THIS 2/Magazine Solution.sln
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Magazine Project", "Magazine Project\Magazine Project.vbproj", "{1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Debug|x86.ActiveCfg = Debug|x86 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Debug|x86.Build.0 = Debug|x86 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Release|x86.ActiveCfg = Release|x86 {1CD6F4C1-C8AD-4897-8C0D-C091F2D212BD}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/MusicBox Solution/MusicBox Project/App.config
Chap25/MusicBox Solution/MusicBox Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.MusicBoxDataSet = New MusicBox_Project.MusicBoxDataSet() Me.TblBoxBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TblBoxTableAdapter = New MusicBox_Project.MusicBoxDataSetTableAdapters.tblBoxTableAdapter() Me.TableAdapterManager = New MusicBox_Project.MusicBoxDataSetTableAdapters.TableAdapterManager() Me.TblBoxDataGridView = New System.Windows.Forms.DataGridView() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.btnAll = New System.Windows.Forms.Button() Me.btnShape = New System.Windows.Forms.Button() Me.btnSource = New System.Windows.Forms.Button() Me.radGift = New System.Windows.Forms.RadioButton() Me.radPurchased = New System.Windows.Forms.RadioButton() Me.radOctagon = New System.Windows.Forms.RadioButton() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.radRound = New System.Windows.Forms.RadioButton() Me.radRectangle = New System.Windows.Forms.RadioButton() Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.btnExit = New System.Windows.Forms.Button() Me.btnCount = New System.Windows.Forms.Button() CType(Me.MusicBoxDataSet, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblBoxBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblBoxDataGridView, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.SuspendLayout() ' 'MusicBoxDataSet ' Me.MusicBoxDataSet.DataSetName = "MusicBoxDataSet" Me.MusicBoxDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' 'TblBoxBindingSource ' Me.TblBoxBindingSource.DataMember = "tblBox" Me.TblBoxBindingSource.DataSource = Me.MusicBoxDataSet ' 'TblBoxTableAdapter ' Me.TblBoxTableAdapter.ClearBeforeFill = True ' 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.tblBoxTableAdapter = Me.TblBoxTableAdapter Me.TableAdapterManager.UpdateOrder = MusicBox_Project.MusicBoxDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'TblBoxDataGridView ' Me.TblBoxDataGridView.AllowUserToAddRows = False Me.TblBoxDataGridView.AllowUserToDeleteRows = False Me.TblBoxDataGridView.AutoGenerateColumns = False Me.TblBoxDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.TblBoxDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.TblBoxDataGridView.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3, Me.DataGridViewTextBoxColumn4}) Me.TblBoxDataGridView.DataSource = Me.TblBoxBindingSource Me.TblBoxDataGridView.Location = New System.Drawing.Point(22, 15) Me.TblBoxDataGridView.Name = "TblBoxDataGridView" Me.TblBoxDataGridView.ReadOnly = True Me.TblBoxDataGridView.RowHeadersVisible = False Me.TblBoxDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.TblBoxDataGridView.Size = New System.Drawing.Size(563, 271) Me.TblBoxDataGridView.TabIndex = 5 ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells Me.DataGridViewTextBoxColumn1.DataPropertyName = "ID" Me.DataGridViewTextBoxColumn1.HeaderText = "ID" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 45 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.DataPropertyName = "Shape" Me.DataGridViewTextBoxColumn2.HeaderText = "Shape" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.DataPropertyName = "Source" Me.DataGridViewTextBoxColumn3.HeaderText = "Source" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True ' 'DataGridViewTextBoxColumn4 ' Me.DataGridViewTextBoxColumn4.DataPropertyName = "Song" Me.DataGridViewTextBoxColumn4.HeaderText = "Song" Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4" Me.DataGridViewTextBoxColumn4.ReadOnly = True ' 'btnAll ' Me.btnAll.Location = New System.Drawing.Point(614, 23) Me.btnAll.Name = "btnAll" Me.btnAll.Size = New System.Drawing.Size(111, 30) Me.btnAll.TabIndex = 0 Me.btnAll.Text = "&All Records" Me.btnAll.UseVisualStyleBackColor = True ' 'btnShape ' Me.btnShape.Location = New System.Drawing.Point(15, 105) Me.btnShape.Name = "btnShape" Me.btnShape.Size = New System.Drawing.Size(111, 30) Me.btnShape.TabIndex = 3 Me.btnShape.Text = "S&hape" Me.btnShape.UseVisualStyleBackColor = True ' 'btnSource ' Me.btnSource.Location = New System.Drawing.Point(6, 87) Me.btnSource.Name = "btnSource" Me.btnSource.Size = New System.Drawing.Size(111, 30) Me.btnSource.TabIndex = 2 Me.btnSource.Text = "&Source" Me.btnSource.UseVisualStyleBackColor = True ' 'radGift ' Me.radGift.AutoSize = True Me.radGift.Checked = True Me.radGift.Location = New System.Drawing.Point(11, 24) Me.radGift.Name = "radGift" Me.radGift.Size = New System.Drawing.Size(46, 21) Me.radGift.TabIndex = 0 Me.radGift.TabStop = True Me.radGift.Text = "&Gift" Me.radGift.UseVisualStyleBackColor = True ' 'radPurchased ' Me.radPurchased.AutoSize = True Me.radPurchased.Location = New System.Drawing.Point(11, 51) Me.radPurchased.Name = "radPurchased" Me.radPurchased.Size = New System.Drawing.Size(86, 21) Me.radPurchased.TabIndex = 1 Me.radPurchased.Text = "&Purchased" Me.radPurchased.UseVisualStyleBackColor = True ' 'radOctagon ' Me.radOctagon.AutoSize = True Me.radOctagon.Checked = True Me.radOctagon.Location = New System.Drawing.Point(15, 19) Me.radOctagon.Name = "radOctagon" Me.radOctagon.Size = New System.Drawing.Size(76, 21) Me.radOctagon.TabIndex = 0 Me.radOctagon.TabStop = True Me.radOctagon.Text = "&Octagon" Me.radOctagon.UseVisualStyleBackColor = True ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.radRound) Me.GroupBox1.Controls.Add(Me.radRectangle) Me.GroupBox1.Controls.Add(Me.radOctagon) Me.GroupBox1.Controls.Add(Me.btnShape) Me.GroupBox1.Location = New System.Drawing.Point(614, 76) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(142, 148) Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False ' 'radRound ' Me.radRound.AutoSize = True Me.radRound.Location = New System.Drawing.Point(15, 73) Me.radRound.Name = "radRound" Me.radRound.Size = New System.Drawing.Size(64, 21) Me.radRound.TabIndex = 2 Me.radRound.Text = "Roun&d" Me.radRound.UseVisualStyleBackColor = True ' 'radRectangle ' Me.radRectangle.AutoSize = True Me.radRectangle.Location = New System.Drawing.Point(15, 46) Me.radRectangle.Name = "radRectangle" Me.radRectangle.Size = New System.Drawing.Size(83, 21) Me.radRectangle.TabIndex = 1 Me.radRectangle.Text = "&Rectangle" Me.radRectangle.UseVisualStyleBackColor = True ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.radGift) Me.GroupBox2.Controls.Add(Me.radPurchased) Me.GroupBox2.Controls.Add(Me.btnSource) Me.GroupBox2.Location = New System.Drawing.Point(786, 76) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(127, 137) Me.GroupBox2.TabIndex = 3 Me.GroupBox2.TabStop = False ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(792, 228) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(111, 30) Me.btnExit.TabIndex = 4 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'btnCount ' Me.btnCount.Location = New System.Drawing.Point(792, 23) Me.btnCount.Name = "btnCount" Me.btnCount.Size = New System.Drawing.Size(111, 30) Me.btnCount.TabIndex = 1 Me.btnCount.Text = "&Count" Me.btnCount.UseVisualStyleBackColor = True ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(946, 311) Me.Controls.Add(Me.btnCount) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.btnAll) Me.Controls.Add(Me.TblBoxDataGridView) Me.Font = New System.Drawing.Font("Segoe UI", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Music Box" CType(Me.MusicBoxDataSet, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblBoxBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblBoxDataGridView, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.GroupBox2.ResumeLayout(False) Me.GroupBox2.PerformLayout() Me.ResumeLayout(False) End Sub Friend WithEvents MusicBoxDataSet As MusicBox_Project.MusicBoxDataSet Friend WithEvents TblBoxBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TblBoxTableAdapter As MusicBox_Project.MusicBoxDataSetTableAdapters.tblBoxTableAdapter Friend WithEvents TableAdapterManager As MusicBox_Project.MusicBoxDataSetTableAdapters.TableAdapterManager Friend WithEvents TblBoxDataGridView As System.Windows.Forms.DataGridView Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn4 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents btnAll As System.Windows.Forms.Button Friend WithEvents btnShape As System.Windows.Forms.Button Friend WithEvents btnSource As System.Windows.Forms.Button Friend WithEvents radGift As System.Windows.Forms.RadioButton Friend WithEvents radPurchased As System.Windows.Forms.RadioButton Friend WithEvents radOctagon As System.Windows.Forms.RadioButton Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents radRound As System.Windows.Forms.RadioButton Friend WithEvents radRectangle As System.Windows.Forms.RadioButton Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCount As System.Windows.Forms.Button End Class
Chap25/MusicBox Solution/MusicBox Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 163, 17 330, 17 491, 17 True True True True True True True True True True True True True True
Chap25/MusicBox Solution/MusicBox Project/frmMain.vb
' Name: MusicBox Project ' Purpose: Selects specific records ' Also displays the number of music boxes ' Programmer: <your name> on <current date> Public Class frmMain Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'MusicBoxDataSet.tblBox' table. You can move, or remove it, as needed. Me.TblBoxTableAdapter.Fill(Me.MusicBoxDataSet.tblBox) End Sub Private Sub btnAll_Click(sender As Object, e As EventArgs) Handles btnAll.Click ' displays all records End Sub Private Sub btnShape_Click(sender As Object, e As EventArgs) Handles btnShape.Click ' displays music boxes having the selected shape End Sub Private Sub btnSource_Click(sender As Object, e As EventArgs) Handles btnSource.Click ' displays either gift music boxes or purchased music boxes End Sub Private Sub btnCount_Click(sender As Object, e As EventArgs) Handles btnCount.Click ' displays the number of music boxes End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub End Class
Chap25/MusicBox Solution/MusicBox Project/MusicBox Project.vbproj
Debug AnyCPU {882F8DAA-66E2-40D5-99E4-EE043CB3F1AD} WinExe MusicBox_Project.My.MyApplication MusicBox_Project MusicBox Project 512 WindowsForms v4.5 AnyCPU true full true true bin\Debug\ MusicBox Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 AnyCPU pdbonly false true true bin\Release\ MusicBox Project.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 On Binary Off On Form frmMain.vb Form True True MusicBoxDataSet.xsd True Application.myapp True True Resources.resx True Settings.settings True frmMain.vb VbMyResourcesResXFileCodeGenerator Resources.Designer.vb My.Resources Designer MusicBoxDataSet.xsd MSDataSetGenerator MusicBoxDataSet.Designer.vb Designer MusicBoxDataSet.xsd MyApplicationCodeGenerator Application.Designer.vb SettingsSingleFileGenerator My Settings.Designer.vb Always
Chap25/MusicBox Solution/MusicBox Project/MusicBox.accdb
| Shape | Source | Song | ID |
|---|---|---|---|
| Round | Purchase | As Time Goes By | 1 |
| Octagon | Gift | Nadia's Theme | 2 |
| Round | Purchase | My Way | 3 |
| Rectangle | Purchase | Clair De Lune | 4 |
| Octagon | Purchase | Beauty and the Beast | 5 |
| Rectangle | Gift | Endless Love | 6 |
| Rectangle | Gift | Yesterday | 7 |
| Octagon | Purchase | You Light Up My Life | 8 |
| Rectangle | Purchase | Edelweiss | 9 |
| Rectangle | Gift | Happy Birthday | 10 |
Chap25/MusicBox Solution/MusicBox Project/MusicBoxDataSet.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On '''<summary> '''Represents a strongly typed in-memory cache of data. '''</summary> <Global.System.Serializable(), _ Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _ Global.System.Xml.Serialization.XmlRootAttribute("MusicBoxDataSet"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _ Partial Public Class MusicBoxDataSet Inherits Global.System.Data.DataSet Private tabletblBox As tblBoxDataTable Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("tblBox")) Is Nothing) Then MyBase.Tables.Add(New tblBoxDataTable(ds.Tables("tblBox"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false), _ Global.System.ComponentModel.DesignerSerializationVisibility(Global.System.ComponentModel.DesignerSerializationVisibility.Content)> _ Public ReadOnly Property tblBox() As tblBoxDataTable Get Return Me.tabletblBox End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.BrowsableAttribute(true), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Visible)> _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.DesignerSerializationVisibilityAttribute(Global.System.ComponentModel.DesignerSerializationVisibility.Hidden)> _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As MusicBoxDataSet = CType(MyBase.Clone,MusicBoxDataSet) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet() ds.ReadXml(reader) If (Not (ds.Tables("tblBox")) Is Nothing) Then MyBase.Tables.Add(New tblBoxDataTable(ds.Tables("tblBox"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tabletblBox = CType(MyBase.Tables("tblBox"),tblBoxDataTable) If (initTable = true) Then If (Not (Me.tabletblBox) Is Nothing) Then Me.tabletblBox.InitVars End If End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.DataSetName = "MusicBoxDataSet" Me.Prefix = "" Me.Namespace = "http://tempuri.org/MusicBoxDataSet.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tabletblBox = New tblBoxDataTable() MyBase.Tables.Add(Me.tabletblBox) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function ShouldSerializetblBox() As Boolean Return false End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As MusicBoxDataSet = New MusicBoxDataSet() Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Delegate Sub tblBoxRowChangeEventHandler(ByVal sender As Object, ByVal e As tblBoxRowChangeEvent) '''<summary> '''Represents the strongly named DataTable class. '''</summary> <Global.System.Serializable(), _ Global.System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _ Partial Public Class tblBoxDataTable Inherits Global.System.Data.TypedTableBase(Of tblBoxRow) Private columnID As Global.System.Data.DataColumn Private columnShape As Global.System.Data.DataColumn Private columnSource As Global.System.Data.DataColumn Private columnSong As Global.System.Data.DataColumn <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.TableName = "tblBox" Me.BeginInit Me.InitClass Me.EndInit End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property IDColumn() As Global.System.Data.DataColumn Get Return Me.columnID End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property ShapeColumn() As Global.System.Data.DataColumn Get Return Me.columnShape End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property SourceColumn() As Global.System.Data.DataColumn Get Return Me.columnSource End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property SongColumn() As Global.System.Data.DataColumn Get Return Me.columnSong End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Default ReadOnly Property Item(ByVal index As Integer) As tblBoxRow Get Return CType(Me.Rows(index),tblBoxRow) End Get End Property <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBoxRowChanging As tblBoxRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBoxRowChanged As tblBoxRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBoxRowDeleting As tblBoxRowChangeEventHandler <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Event tblBoxRowDeleted As tblBoxRowChangeEventHandler <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Sub AddtblBoxRow(ByVal row As tblBoxRow) Me.Rows.Add(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overloads Function AddtblBoxRow(ByVal ID As String, ByVal Shape As String, ByVal Source As String, ByVal Song As String) As tblBoxRow Dim rowtblBoxRow As tblBoxRow = CType(Me.NewRow,tblBoxRow) Dim columnValuesArray() As Object = New Object() {ID, Shape, Source, Song} rowtblBoxRow.ItemArray = columnValuesArray Me.Rows.Add(rowtblBoxRow) Return rowtblBoxRow End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function FindByID(ByVal ID As String) As tblBoxRow Return CType(Me.Rows.Find(New Object() {ID}),tblBoxRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As tblBoxDataTable = CType(MyBase.Clone,tblBoxDataTable) cln.InitVars Return cln End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New tblBoxDataTable() End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub InitVars() Me.columnID = MyBase.Columns("ID") Me.columnShape = MyBase.Columns("Shape") Me.columnSource = MyBase.Columns("Source") Me.columnSong = MyBase.Columns("Song") End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitClass() Me.columnID = New Global.System.Data.DataColumn("ID", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnID) Me.columnShape = New Global.System.Data.DataColumn("Shape", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnShape) Me.columnSource = New Global.System.Data.DataColumn("Source", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnSource) Me.columnSong = New Global.System.Data.DataColumn("Song", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnSong) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnID}, true)) Me.columnID.AllowDBNull = false Me.columnID.Unique = true Me.columnID.MaxLength = 255 Me.columnShape.MaxLength = 255 Me.columnSource.MaxLength = 255 Me.columnSong.MaxLength = 255 End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function NewtblBoxRow() As tblBoxRow Return CType(Me.NewRow,tblBoxRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New tblBoxRow(builder) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(tblBoxRow) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.tblBoxRowChangedEvent) Is Nothing) Then RaiseEvent tblBoxRowChanged(Me, New tblBoxRowChangeEvent(CType(e.Row,tblBoxRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.tblBoxRowChangingEvent) Is Nothing) Then RaiseEvent tblBoxRowChanging(Me, New tblBoxRowChangeEvent(CType(e.Row,tblBoxRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.tblBoxRowDeletedEvent) Is Nothing) Then RaiseEvent tblBoxRowDeleted(Me, New tblBoxRowChangeEvent(CType(e.Row,tblBoxRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.tblBoxRowDeletingEvent) Is Nothing) Then RaiseEvent tblBoxRowDeleting(Me, New tblBoxRowChangeEvent(CType(e.Row,tblBoxRow), e.Action)) End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub RemovetblBoxRow(ByVal row As tblBoxRow) Me.Rows.Remove(row) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType() Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence() Dim ds As MusicBoxDataSet = New MusicBoxDataSet() Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny() any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute() attribute2.Name = "tableTypeName" attribute2.FixedValue = "tblBoxDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream() Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class '''<summary> '''Represents strongly named DataRow class. '''</summary> Partial Public Class tblBoxRow Inherits Global.System.Data.DataRow Private tabletblBox As tblBoxDataTable <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tabletblBox = CType(Me.Table,tblBoxDataTable) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property ID() As String Get Return CType(Me(Me.tabletblBox.IDColumn),String) End Get Set Me(Me.tabletblBox.IDColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Shape() As String Get Try Return CType(Me(Me.tabletblBox.ShapeColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Shape' in table 'tblBox' is DBNull.", e) End Try End Get Set Me(Me.tabletblBox.ShapeColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Source() As String Get Try Return CType(Me(Me.tabletblBox.SourceColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Source' in table 'tblBox' is DBNull.", e) End Try End Get Set Me(Me.tabletblBox.SourceColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property Song() As String Get Try Return CType(Me(Me.tabletblBox.SongColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Song' in table 'tblBox' is DBNull.", e) End Try End Get Set Me(Me.tabletblBox.SongColumn) = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsShapeNull() As Boolean Return Me.IsNull(Me.tabletblBox.ShapeColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetShapeNull() Me(Me.tabletblBox.ShapeColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsSourceNull() As Boolean Return Me.IsNull(Me.tabletblBox.SourceColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetSourceNull() Me(Me.tabletblBox.SourceColumn) = Global.System.Convert.DBNull End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function IsSongNull() As Boolean Return Me.IsNull(Me.tabletblBox.SongColumn) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub SetSongNull() Me(Me.tabletblBox.SongColumn) = Global.System.Convert.DBNull End Sub End Class '''<summary> '''Row event argument class '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Class tblBoxRowChangeEvent Inherits Global.System.EventArgs Private eventRow As tblBoxRow Private eventAction As Global.System.Data.DataRowAction <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New(ByVal row As tblBoxRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Row() As tblBoxRow Get Return Me.eventRow End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace MusicBoxDataSetTableAdapters '''<summary> '''Represents the connection and commands used to retrieve and save data. '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DataObjectAttribute(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _ ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Partial Public Class tblBoxTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.OleDb.OleDbDataAdapter Private _connection As Global.System.Data.OleDb.OleDbConnection Private _transaction As Global.System.Data.OleDb.OleDbTransaction Private _commandCollection() As Global.System.Data.OleDb.OleDbCommand Private _clearBeforeFill As Boolean <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Friend ReadOnly Property Adapter() As Global.System.Data.OleDb.OleDbDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Connection() As Global.System.Data.OleDb.OleDbConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.OleDb.OleDbCommand).Connection = value End If i = (i + 1) Loop End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Property Transaction() As Global.System.Data.OleDb.OleDbTransaction Get Return Me._transaction End Get Set Me._transaction = value Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) Me.CommandCollection(i).Transaction = Me._transaction i = (i + 1) Loop If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.DeleteCommand) Is Nothing)) Then Me.Adapter.DeleteCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.InsertCommand) Is Nothing)) Then Me.Adapter.InsertCommand.Transaction = Me._transaction End If If ((Not (Me.Adapter) Is Nothing) _ AndAlso (Not (Me.Adapter.UpdateCommand) Is Nothing)) Then Me.Adapter.UpdateCommand.Transaction = Me._transaction End If End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected ReadOnly Property CommandCollection() As Global.System.Data.OleDb.OleDbCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.OleDb.OleDbDataAdapter() Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping() tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "tblBox" tableMapping.ColumnMappings.Add("ID", "ID") tableMapping.ColumnMappings.Add("Shape", "Shape") tableMapping.ColumnMappings.Add("Source", "Source") tableMapping.ColumnMappings.Add("Song", "Song") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM `tblBox` WHERE ((`ID` = ?) AND ((? = 1 AND `Shape` IS NULL) OR (`Shap"& _ "e` = ?)) AND ((? = 1 AND `Source` IS NULL) OR (`Source` = ?)) AND ((? = 1 AND `S"& _ "ong` IS NULL) OR (`Song` = ?)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Shape", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Shape", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Shape", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Shape", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Source", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Source", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Source", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Source", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Song", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Song", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Song", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Song", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.InsertCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO `tblBox` (`ID`, `Shape`, `Source`, `Song`) VALUES (?, ?, ?, ?)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ID", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Shape", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Shape", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Source", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Source", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Song", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Song", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand = New Global.System.Data.OleDb.OleDbCommand() Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE `tblBox` SET `ID` = ?, `Shape` = ?, `Source` = ?, `Song` = ? WHERE ((`ID` "& _ "= ?) AND ((? = 1 AND `Shape` IS NULL) OR (`Shape` = ?)) AND ((? = 1 AND `Source`"& _ " IS NULL) OR (`Source` = ?)) AND ((? = 1 AND `Song` IS NULL) OR (`Song` = ?)))" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("ID", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Shape", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Shape", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Source", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Source", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Song", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Song", Global.System.Data.DataRowVersion.Current, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_ID", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Shape", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Shape", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Shape", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Shape", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Source", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Source", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Source", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Source", Global.System.Data.DataRowVersion.Original, false, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("IsNull_Song", Global.System.Data.OleDb.OleDbType.[Integer], 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Song", Global.System.Data.DataRowVersion.Original, true, Nothing)) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.OleDb.OleDbParameter("Original_Song", Global.System.Data.OleDb.OleDbType.VarWChar, 0, Global.System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Song", Global.System.Data.DataRowVersion.Original, false, Nothing)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitConnection() Me._connection = New Global.System.Data.OleDb.OleDbConnection() Me._connection.ConnectionString = Global.MusicBox_Project.My.MySettings.Default.MusicBoxConnectionString End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.OleDb.OleDbCommand(0) {} Me._commandCollection(0) = New Global.System.Data.OleDb.OleDbCommand() Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT ID, Shape, Source, Song FROM tblBox" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, true)> _ Public Overloads Overridable Function Fill(ByVal dataTable As MusicBoxDataSet.tblBoxDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.[Select], true)> _ Public Overloads Overridable Function GetData() As MusicBoxDataSet.tblBoxDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As MusicBoxDataSet.tblBoxDataTable = New MusicBoxDataSet.tblBoxDataTable() Me.Adapter.Fill(dataTable) Return dataTable End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataTable As MusicBoxDataSet.tblBoxDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataSet As MusicBoxDataSet) As Integer Return Me.Adapter.Update(dataSet, "tblBox") End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Delete, true)> _ Public Overloads Overridable Function Delete(ByVal Original_ID As String, ByVal Original_Shape As String, ByVal Original_Source As String, ByVal Original_Song As String) As Integer If (Original_ID Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_ID,String) End If If (Original_Shape Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_Shape,String) End If If (Original_Source Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(3).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(4).Value = CType(Original_Source,String) End If If (Original_Song Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(5).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(6).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(5).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(6).Value = CType(Original_Song,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Insert, true)> _ Public Overloads Overridable Function Insert(ByVal ID As String, ByVal Shape As String, ByVal Source As String, ByVal Song As String) As Integer If (ID Is Nothing) Then Me.Adapter.InsertCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(0).Value = CType(ID,String) End If If (Shape Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(Shape,String) End If If (Source Is Nothing) Then Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(2).Value = CType(Source,String) End If If (Song Is Nothing) Then Me.Adapter.InsertCommand.Parameters(3).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(3).Value = CType(Song,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal ID As String, ByVal Shape As String, ByVal Source As String, ByVal Song As String, ByVal Original_ID As String, ByVal Original_Shape As String, ByVal Original_Source As String, ByVal Original_Song As String) As Integer If (ID Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(0).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(0).Value = CType(ID,String) End If If (Shape Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(Shape,String) End If If (Source Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Source,String) End If If (Song Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(3).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Song,String) End If If (Original_ID Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Original_ID,String) End If If (Original_Shape Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(5).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(6).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(5).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(6).Value = CType(Original_Shape,String) End If If (Original_Source Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(7).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(8).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(7).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(8).Value = CType(Original_Source,String) End If If (Original_Song Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(9).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(10).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(9).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(10).Value = CType(Original_Song,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _ Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Update, true)> _ Public Overloads Overridable Function Update(ByVal Shape As String, ByVal Source As String, ByVal Song As String, ByVal Original_ID As String, ByVal Original_Shape As String, ByVal Original_Source As String, ByVal Original_Song As String) As Integer Return Me.Update(Original_ID, Shape, Source, Song, Original_ID, Original_Shape, Original_Source, Original_Song) End Function End Class '''<summary> '''TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios '''</summary> <Global.System.ComponentModel.DesignerCategoryAttribute("code"), _ Global.System.ComponentModel.ToolboxItem(true), _ Global.System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD"& _ "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _ Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")> _ Partial Public Class TableAdapterManager Inherits Global.System.ComponentModel.Component Private _updateOrder As UpdateOrderOption Private _tblBoxTableAdapter As tblBoxTableAdapter Private _backupDataSetBeforeUpdate As Boolean Private _connection As Global.System.Data.IDbConnection <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property UpdateOrder() As UpdateOrderOption Get Return Me._updateOrder End Get Set Me._updateOrder = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso"& _ "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3"& _ "a", "System.Drawing.Design.UITypeEditor")> _ Public Property tblBoxTableAdapter() As tblBoxTableAdapter Get Return Me._tblBoxTableAdapter End Get Set Me._tblBoxTableAdapter = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Property BackupDataSetBeforeUpdate() As Boolean Get Return Me._backupDataSetBeforeUpdate End Get Set Me._backupDataSetBeforeUpdate = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public Property Connection() As Global.System.Data.IDbConnection Get If (Not (Me._connection) Is Nothing) Then Return Me._connection End If If ((Not (Me._tblBoxTableAdapter) Is Nothing) _ AndAlso (Not (Me._tblBoxTableAdapter.Connection) Is Nothing)) Then Return Me._tblBoxTableAdapter.Connection End If Return Nothing End Get Set Me._connection = value End Set End Property <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"), _ Global.System.ComponentModel.Browsable(false)> _ Public ReadOnly Property TableAdapterInstanceCount() As Integer Get Dim count As Integer = 0 If (Not (Me._tblBoxTableAdapter) Is Nothing) Then count = (count + 1) End If Return count End Get End Property '''<summary> '''Update rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateUpdatedRows(ByVal dataSet As MusicBoxDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow), ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblBoxTableAdapter) Is Nothing) Then Dim updatedRows() As Global.System.Data.DataRow = dataSet.tblBox.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.ModifiedCurrent) updatedRows = Me.GetRealUpdatedRows(updatedRows, allAddedRows) If ((Not (updatedRows) Is Nothing) _ AndAlso (0 < updatedRows.Length)) Then result = (result + Me._tblBoxTableAdapter.Update(updatedRows)) allChangedRows.AddRange(updatedRows) End If End If Return result End Function '''<summary> '''Insert rows in top-down order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateInsertedRows(ByVal dataSet As MusicBoxDataSet, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblBoxTableAdapter) Is Nothing) Then Dim addedRows() As Global.System.Data.DataRow = dataSet.tblBox.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Added) If ((Not (addedRows) Is Nothing) _ AndAlso (0 < addedRows.Length)) Then result = (result + Me._tblBoxTableAdapter.Update(addedRows)) allAddedRows.AddRange(addedRows) End If End If Return result End Function '''<summary> '''Delete rows in bottom-up order. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function UpdateDeletedRows(ByVal dataSet As MusicBoxDataSet, ByVal allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Integer Dim result As Integer = 0 If (Not (Me._tblBoxTableAdapter) Is Nothing) Then Dim deletedRows() As Global.System.Data.DataRow = dataSet.tblBox.Select(Nothing, Nothing, Global.System.Data.DataViewRowState.Deleted) If ((Not (deletedRows) Is Nothing) _ AndAlso (0 < deletedRows.Length)) Then result = (result + Me._tblBoxTableAdapter.Update(deletedRows)) allChangedRows.AddRange(deletedRows) End If End If Return result End Function '''<summary> '''Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRealUpdatedRows(ByVal updatedRows() As Global.System.Data.DataRow, ByVal allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)) As Global.System.Data.DataRow() If ((updatedRows Is Nothing) _ OrElse (updatedRows.Length < 1)) Then Return updatedRows End If If ((allAddedRows Is Nothing) _ OrElse (allAddedRows.Count < 1)) Then Return updatedRows End If Dim realUpdatedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim i As Integer = 0 Do While (i < updatedRows.Length) Dim row As Global.System.Data.DataRow = updatedRows(i) If (allAddedRows.Contains(row) = false) Then realUpdatedRows.Add(row) End If i = (i + 1) Loop Return realUpdatedRows.ToArray End Function '''<summary> '''Update all changes to the dataset. '''</summary> <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Overridable Function UpdateAll(ByVal dataSet As MusicBoxDataSet) As Integer If (dataSet Is Nothing) Then Throw New Global.System.ArgumentNullException("dataSet") End If If (dataSet.HasChanges = false) Then Return 0 End If If ((Not (Me._tblBoxTableAdapter) Is Nothing) _ AndAlso (Me.MatchTableAdapterConnection(Me._tblBoxTableAdapter.Connection) = false)) Then Throw New Global.System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s"& _ "tring.") End If Dim workConnection As Global.System.Data.IDbConnection = Me.Connection If (workConnection Is Nothing) Then Throw New Global.System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana"& _ "ger TableAdapter property to a valid TableAdapter instance.") End If Dim workConnOpened As Boolean = false If ((workConnection.State And Global.System.Data.ConnectionState.Broken) _ = Global.System.Data.ConnectionState.Broken) Then workConnection.Close End If If (workConnection.State = Global.System.Data.ConnectionState.Closed) Then workConnection.Open workConnOpened = true End If Dim workTransaction As Global.System.Data.IDbTransaction = workConnection.BeginTransaction If (workTransaction Is Nothing) Then Throw New Global.System.ApplicationException("The transaction cannot begin. The current data connection does not support transa"& _ "ctions or the current state is not allowing the transaction to begin.") End If Dim allChangedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim allAddedRows As Global.System.Collections.Generic.List(Of Global.System.Data.DataRow) = New Global.System.Collections.Generic.List(Of Global.System.Data.DataRow)() Dim adaptersWithAcceptChangesDuringUpdate As Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter) = New Global.System.Collections.Generic.List(Of Global.System.Data.Common.DataAdapter)() Dim revertConnections As Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection) = New Global.System.Collections.Generic.Dictionary(Of Object, Global.System.Data.IDbConnection)() Dim result As Integer = 0 Dim backupDataSet As Global.System.Data.DataSet = Nothing If Me.BackupDataSetBeforeUpdate Then backupDataSet = New Global.System.Data.DataSet() backupDataSet.Merge(dataSet) End If Try '---- Prepare for update ----------- ' If (Not (Me._tblBoxTableAdapter) Is Nothing) Then revertConnections.Add(Me._tblBoxTableAdapter, Me._tblBoxTableAdapter.Connection) Me._tblBoxTableAdapter.Connection = CType(workConnection,Global.System.Data.OleDb.OleDbConnection) Me._tblBoxTableAdapter.Transaction = CType(workTransaction,Global.System.Data.OleDb.OleDbTransaction) If Me._tblBoxTableAdapter.Adapter.AcceptChangesDuringUpdate Then Me._tblBoxTableAdapter.Adapter.AcceptChangesDuringUpdate = false adaptersWithAcceptChangesDuringUpdate.Add(Me._tblBoxTableAdapter.Adapter) End If End If ' '---- Perform updates ----------- ' If (Me.UpdateOrder = UpdateOrderOption.UpdateInsertDelete) Then result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) Else result = (result + Me.UpdateInsertedRows(dataSet, allAddedRows)) result = (result + Me.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)) End If result = (result + Me.UpdateDeletedRows(dataSet, allChangedRows)) ' '---- Commit updates ----------- ' workTransaction.Commit If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If If (0 < allChangedRows.Count) Then Dim rows((allChangedRows.Count) - 1) As Global.System.Data.DataRow allChangedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges i = (i + 1) Loop End If Catch ex As Global.System.Exception workTransaction.Rollback '---- Restore the dataset ----------- If Me.BackupDataSetBeforeUpdate Then Global.System.Diagnostics.Debug.Assert((Not (backupDataSet) Is Nothing)) dataSet.Clear dataSet.Merge(backupDataSet) Else If (0 < allAddedRows.Count) Then Dim rows((allAddedRows.Count) - 1) As Global.System.Data.DataRow allAddedRows.CopyTo(rows) Dim i As Integer = 0 Do While (i < rows.Length) Dim row As Global.System.Data.DataRow = rows(i) row.AcceptChanges row.SetAdded i = (i + 1) Loop End If End If Throw ex Finally If workConnOpened Then workConnection.Close End If If (Not (Me._tblBoxTableAdapter) Is Nothing) Then Me._tblBoxTableAdapter.Connection = CType(revertConnections(Me._tblBoxTableAdapter),Global.System.Data.OleDb.OleDbConnection) Me._tblBoxTableAdapter.Transaction = Nothing End If If (0 < adaptersWithAcceptChangesDuringUpdate.Count) Then Dim adapters((adaptersWithAcceptChangesDuringUpdate.Count) - 1) As Global.System.Data.Common.DataAdapter adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters) Dim i As Integer = 0 Do While (i < adapters.Length) Dim adapter As Global.System.Data.Common.DataAdapter = adapters(i) adapter.AcceptChangesDuringUpdate = true i = (i + 1) Loop End If End Try Return result End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Sub SortSelfReferenceRows(ByVal rows() As Global.System.Data.DataRow, ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) Global.System.Array.Sort(Of Global.System.Data.DataRow)(rows, New SelfReferenceComparer(relation, childFirst)) End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Protected Overridable Function MatchTableAdapterConnection(ByVal inputConnection As Global.System.Data.IDbConnection) As Boolean If (Not (Me._connection) Is Nothing) Then Return true End If If ((Me.Connection Is Nothing) _ OrElse (inputConnection Is Nothing)) Then Return true End If If String.Equals(Me.Connection.ConnectionString, inputConnection.ConnectionString, Global.System.StringComparison.Ordinal) Then Return true End If Return false End Function '''<summary> '''Update Order Option '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Enum UpdateOrderOption InsertUpdateDelete = 0 UpdateInsertDelete = 1 End Enum '''<summary> '''Used to sort self-referenced table's rows '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Class SelfReferenceComparer Inherits Object Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow) Private _relation As Global.System.Data.DataRelation Private _childFirst As Integer <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Friend Sub New(ByVal relation As Global.System.Data.DataRelation, ByVal childFirst As Boolean) MyBase.New Me._relation = relation If childFirst Then Me._childFirst = -1 Else Me._childFirst = 1 End If End Sub <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Private Function GetRoot(ByVal row As Global.System.Data.DataRow, ByRef distance As Integer) As Global.System.Data.DataRow Global.System.Diagnostics.Debug.Assert((Not (row) Is Nothing)) Dim root As Global.System.Data.DataRow = row distance = 0 Dim traversedRows As Global.System.Collections.Generic.IDictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow) = New Global.System.Collections.Generic.Dictionary(Of Global.System.Data.DataRow, Global.System.Data.DataRow)() traversedRows(row) = row Dim parent As Global.System.Data.DataRow = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.[Default]) Loop If (distance = 0) Then traversedRows.Clear traversedRows(row) = row parent = row.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Do While ((Not (parent) Is Nothing) _ AndAlso (traversedRows.ContainsKey(parent) = false)) distance = (distance + 1) root = parent traversedRows(parent) = parent parent = parent.GetParentRow(Me._relation, Global.System.Data.DataRowVersion.Original) Loop End If Return root End Function <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")> _ Public Function Compare(ByVal row1 As Global.System.Data.DataRow, ByVal row2 As Global.System.Data.DataRow) As Integer Implements Global.System.Collections.Generic.IComparer(Of Global.System.Data.DataRow).Compare If Object.ReferenceEquals(row1, row2) Then Return 0 End If If (row1 Is Nothing) Then Return -1 End If If (row2 Is Nothing) Then Return 1 End If Dim distance1 As Integer = 0 Dim root1 As Global.System.Data.DataRow = Me.GetRoot(row1, distance1) Dim distance2 As Integer = 0 Dim root2 As Global.System.Data.DataRow = Me.GetRoot(row2, distance2) If Object.ReferenceEquals(root1, root2) Then Return (Me._childFirst * distance1.CompareTo(distance2)) Else Global.System.Diagnostics.Debug.Assert(((Not (root1.Table) Is Nothing) _ AndAlso (Not (root2.Table) Is Nothing))) If (root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2)) Then Return -1 Else Return 1 End If End If End Function End Class End Class End Namespace
Chap25/MusicBox Solution/MusicBox Project/MusicBoxDataSet.xsc
Chap25/MusicBox Solution/MusicBox Project/MusicBoxDataSet.xsd
DELETE FROM `tblBox` WHERE ((`ID` = ?) AND ((? = 1 AND `Shape` IS NULL) OR (`Shape` = ?)) AND ((? = 1 AND `Source` IS NULL) OR (`Source` = ?)) AND ((? = 1 AND `Song` IS NULL) OR (`Song` = ?))) INSERT INTO `tblBox` (`ID`, `Shape`, `Source`, `Song`) VALUES (?, ?, ?, ?) SELECT ID, Shape, Source, Song FROM tblBox UPDATE `tblBox` SET `ID` = ?, `Shape` = ?, `Source` = ?, `Song` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `Shape` IS NULL) OR (`Shape` = ?)) AND ((? = 1 AND `Source` IS NULL) OR (`Source` = ?)) AND ((? = 1 AND `Song` IS NULL) OR (`Song` = ?)))
Chap25/MusicBox Solution/MusicBox Project/MusicBoxDataSet.xss
Chap25/MusicBox Solution/MusicBox Project/My Project/Application.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.MusicBox_Project.frmMain End Sub End Class End Namespace
Chap25/MusicBox Solution/MusicBox Project/My Project/Application.myapp
<?xml version="1.0" encoding="utf-16"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> <MainForm>frmMain</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>0</ShutdownMode> <EnableVisualStyles>true</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
Chap25/MusicBox Solution/MusicBox Project/My Project/AssemblyInfo.vb
Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("MusicBox Project")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("MusicBox Project")> <Assembly: AssemblyCopyright("Copyright © 2012")> <Assembly: AssemblyTrademark("")> <Assembly: ComVisible(False)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("168c62ca-72a9-4f75-a79d-c1de8d673822")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> <Assembly: AssemblyVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
Chap25/MusicBox Solution/MusicBox Project/My Project/Resources.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My.Resources 'This class was auto-generated by the StronglyTypedResourceBuilder 'class via a tool like ResGen or Visual Studio. 'To add or remove a member, edit your .ResX file then rerun ResGen 'with the /str option, or rebuild your VS project. '''<summary> ''' A strongly-typed resource class, for looking up localized strings, etc. '''</summary> <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Friend Module Resources Private resourceMan As Global.System.Resources.ResourceManager Private resourceCulture As Global.System.Globalization.CultureInfo '''<summary> ''' Returns the cached ResourceManager instance used by this class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MusicBox_Project.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan End Get End Property '''<summary> ''' Overrides the current thread's CurrentUICulture property for all ''' resource lookups using this strongly typed resource class. '''</summary> <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Friend Property Culture() As Global.System.Globalization.CultureInfo Get Return resourceCulture End Get Set(ByVal value As Global.System.Globalization.CultureInfo) resourceCulture = value End Set End Property End Module End Namespace
Chap25/MusicBox Solution/MusicBox Project/My Project/Resources.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Chap25/MusicBox Solution/MusicBox Project/My Project/Settings.Designer.vb
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.18010 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MusicBox.accdb")> _ Public ReadOnly Property MusicBoxConnectionString() As String Get Return CType(Me("MusicBoxConnectionString"),String) End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.MusicBox_Project.My.MySettings Get Return Global.MusicBox_Project.My.MySettings.Default End Get End Property End Module End Namespace
Chap25/MusicBox Solution/MusicBox Project/My Project/Settings.settings
<?xml version="1.0" encoding="utf-16"?> <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MusicBox.accdb</ConnectionString> <ProviderName>System.Data.OleDb</ProviderName> </SerializableConnectionString> Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\MusicBox.accdb
Chap25/MusicBox Solution/MusicBox Solution.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MusicBox Project", "MusicBox Project\MusicBox Project.vbproj", "{882F8DAA-66E2-40D5-99E4-EE043CB3F1AD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {882F8DAA-66E2-40D5-99E4-EE043CB3F1AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {882F8DAA-66E2-40D5-99E4-EE043CB3F1AD}.Debug|Any CPU.Build.0 = Debug|Any CPU {882F8DAA-66E2-40D5-99E4-EE043CB3F1AD}.Release|Any CPU.ActiveCfg = Release|Any CPU {882F8DAA-66E2-40D5-99E4-EE043CB3F1AD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
Chap25/Red Dragon Solution/Red Dragon Project/App.config
Chap25/Red Dragon Solution/Red Dragon Project/frmMain.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmMain Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.GamesDataSet = New Red_Dragon_Project.GamesDataSet() Me.TblGamesBindingSource = New System.Windows.Forms.BindingSource(Me.components) Me.TblGamesTableAdapter = New Red_Dragon_Project.GamesDataSetTableAdapters.tblGamesTableAdapter() Me.TableAdapterManager = New Red_Dragon_Project.GamesDataSetTableAdapters.TableAdapterManager() Me.TblGamesDataGridView = New System.Windows.Forms.DataGridView() Me.btnFind = New System.Windows.Forms.Button() Me.btnNew = New System.Windows.Forms.Button() Me.btnUsed = New System.Windows.Forms.Button() Me.btnAll = New System.Windows.Forms.Button() Me.btnAvg = New System.Windows.Forms.Button() Me.btnExit = New System.Windows.Forms.Button() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn3 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn4 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn5 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn6 = New System.Windows.Forms.DataGridViewTextBoxColumn() CType(Me.GamesDataSet, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblGamesBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TblGamesDataGridView, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'GamesDataSet ' Me.GamesDataSet.DataSetName = "GamesDataSet" Me.GamesDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema ' 'TblGamesBindingSource ' Me.TblGamesBindingSource.DataMember = "tblGames" Me.TblGamesBindingSource.DataSource = Me.GamesDataSet ' 'TblGamesTableAdapter ' Me.TblGamesTableAdapter.ClearBeforeFill = True ' 'TableAdapterManager ' Me.TableAdapterManager.BackupDataSetBeforeUpdate = False Me.TableAdapterManager.tblGamesTableAdapter = Me.TblGamesTableAdapter Me.TableAdapterManager.UpdateOrder = Red_Dragon_Project.GamesDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete ' 'TblGamesDataGridView ' Me.TblGamesDataGridView.AllowUserToAddRows = False Me.TblGamesDataGridView.AllowUserToDeleteRows = False Me.TblGamesDataGridView.AutoGenerateColumns = False Me.TblGamesDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.TblGamesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.TblGamesDataGridView.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.DataGridViewTextBoxColumn1, Me.DataGridViewTextBoxColumn2, Me.DataGridViewTextBoxColumn3, Me.DataGridViewTextBoxColumn4, Me.DataGridViewTextBoxColumn5, Me.DataGridViewTextBoxColumn6}) Me.TblGamesDataGridView.DataSource = Me.TblGamesBindingSource Me.TblGamesDataGridView.Location = New System.Drawing.Point(37, 12) Me.TblGamesDataGridView.Name = "TblGamesDataGridView" Me.TblGamesDataGridView.ReadOnly = True Me.TblGamesDataGridView.RowHeadersVisible = False Me.TblGamesDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.TblGamesDataGridView.Size = New System.Drawing.Size(645, 251) Me.TblGamesDataGridView.TabIndex = 0 ' 'btnFind ' Me.btnFind.Location = New System.Drawing.Point(37, 307) Me.btnFind.Name = "btnFind" Me.btnFind.Size = New System.Drawing.Size(105, 36) Me.btnFind.TabIndex = 1 Me.btnFind.Text = "&Find Game" Me.btnFind.UseVisualStyleBackColor = True ' 'btnNew ' Me.btnNew.Location = New System.Drawing.Point(148, 307) Me.btnNew.Name = "btnNew" Me.btnNew.Size = New System.Drawing.Size(105, 36) Me.btnNew.TabIndex = 2 Me.btnNew.Text = "&New Games" Me.btnNew.UseVisualStyleBackColor = True ' 'btnUsed ' Me.btnUsed.Location = New System.Drawing.Point(259, 307) Me.btnUsed.Name = "btnUsed" Me.btnUsed.Size = New System.Drawing.Size(105, 36) Me.btnUsed.TabIndex = 3 Me.btnUsed.Text = "&Used Games" Me.btnUsed.UseVisualStyleBackColor = True ' 'btnAll ' Me.btnAll.Location = New System.Drawing.Point(370, 307) Me.btnAll.Name = "btnAll" Me.btnAll.Size = New System.Drawing.Size(105, 36) Me.btnAll.TabIndex = 4 Me.btnAll.Text = "&All Games" Me.btnAll.UseVisualStyleBackColor = True ' 'btnAvg ' Me.btnAvg.Location = New System.Drawing.Point(481, 307) Me.btnAvg.Name = "btnAvg" Me.btnAvg.Size = New System.Drawing.Size(119, 36) Me.btnAvg.TabIndex = 5 Me.btnAvg.Text = "Average &Price" Me.btnAvg.UseVisualStyleBackColor = True ' 'btnExit ' Me.btnExit.Location = New System.Drawing.Point(607, 307) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(75, 36) Me.btnExit.TabIndex = 6 Me.btnExit.Text = "E&xit" Me.btnExit.UseVisualStyleBackColor = True ' 'DataGridViewTextBoxColumn1 ' Me.DataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn1.DataPropertyName = "ID" DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle1.Format = "N0" DataGridViewCellStyle1.NullValue = Nothing Me.DataGridViewTextBoxColumn1.DefaultCellStyle = DataGridViewCellStyle1 Me.DataGridViewTextBoxColumn1.HeaderText = "ID" Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1" Me.DataGridViewTextBoxColumn1.ReadOnly = True Me.DataGridViewTextBoxColumn1.Width = 49 ' 'DataGridViewTextBoxColumn2 ' Me.DataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells Me.DataGridViewTextBoxColumn2.DataPropertyName = "Title" Me.DataGridViewTextBoxColumn2.HeaderText = "Title" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" Me.DataGridViewTextBoxColumn2.ReadOnly = True Me.DataGridViewTextBoxColumn2.Width = 63 ' 'DataGridViewTextBoxColumn3 ' Me.DataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn3.DataPropertyName = "Platform" Me.DataGridViewTextBoxColumn3.HeaderText = "Platform" Me.DataGridViewTextBoxColumn3.Name = "DataGridViewTextBoxColumn3" Me.DataGridViewTextBoxColumn3.ReadOnly = True Me.DataGridViewTextBoxColumn3.Width = 91 ' 'DataGridViewTextBoxColumn4 ' Me.DataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn4.DataPropertyName = "Rating" Me.DataGridViewTextBoxColumn4.HeaderText = "Rating" Me.DataGridViewTextBoxColumn4.Name = "DataGridViewTextBoxColumn4" Me.DataGridViewTextBoxColumn4.ReadOnly = True Me.DataGridViewTextBoxColumn4.Width = 77 ' 'DataGridViewTextBoxColumn5 ' Me.DataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells Me.DataGridViewTextBoxColumn5.DataPropertyName = "Price" DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight DataGridViewCellStyle2.Format = "N2" DataGridViewCellStyle2.NullValue = Nothing Me.DataGridViewTextBoxColumn5.DefaultCellStyle = DataGridViewCellStyle2 Me.DataGridViewTextBoxColumn5.HeaderText = "Price" Me.DataGridViewTextBoxColumn5.Name = "DataGridViewTextBoxColumn5" Me.DataGridViewTextBoxColumn5.ReadOnly = True Me.DataGridViewTextBoxColumn5.Width = 66 ' 'DataGridViewTextBoxColumn6 ' Me.DataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader Me.DataGridViewTextBoxColumn6.DataPropertyName = "NewUsed" Me.DataGridViewTextBoxColumn6.HeaderText = "NewUsed" Me.DataGridViewTextBoxColumn6.Name = "DataGridViewTextBoxColumn6" Me.DataGridViewTextBoxColumn6.ReadOnly = True Me.DataGridViewTextBoxColumn6.Width = 97 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 20.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(713, 373) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnAvg) Me.Controls.Add(Me.btnAll) Me.Controls.Add(Me.btnUsed) Me.Controls.Add(Me.btnNew) Me.Controls.Add(Me.btnFind) Me.Controls.Add(Me.TblGamesDataGridView) Me.Font = New System.Drawing.Font("Segoe UI", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.Name = "frmMain" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Red Dragon Games" CType(Me.GamesDataSet, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblGamesBindingSource, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TblGamesDataGridView, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents GamesDataSet As Red_Dragon_Project.GamesDataSet Friend WithEvents TblGamesBindingSource As System.Windows.Forms.BindingSource Friend WithEvents TblGamesTableAdapter As Red_Dragon_Project.GamesDataSetTableAdapters.tblGamesTableAdapter Friend WithEvents TableAdapterManager As Red_Dragon_Project.GamesDataSetTableAdapters.TableAdapterManager Friend WithEvents TblGamesDataGridView As System.Windows.Forms.DataGridView Friend WithEvents btnFind As System.Windows.Forms.Button Friend WithEvents btnNew As System.Windows.Forms.Button Friend WithEvents btnUsed As System.Windows.Forms.Button Friend WithEvents btnAll As System.Windows.Forms.Button Friend WithEvents btnAvg As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents DataGridViewTextBoxColumn1 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn2 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn3 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn4 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn5 As System.Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents DataGridViewTextBoxColumn6 As System.Windows.Forms.DataGridViewTextBoxColumn End Class
Chap25/Red Dragon Solution/Red Dragon Project/frmMain.resx
text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 17, 17 148, 17 332, 17 511, 17 True True True True True True True True