From 40ac78074b241a16e03a340e19847f08f9488808 Mon Sep 17 00:00:00 2001 From: Amrit Panesar Date: Wed, 22 Apr 2015 20:46:29 -0700 Subject: [PATCH] VisualBasic Mysql Playground Signed-off-by: Amrit Panesar --- .../MySQLPlayground/MySQLPlayground.sln | 20 +++ .../MySQLPlayground/Module1.vb | 32 +++++ .../My Project/Application.Designer.vb | 13 ++ .../My Project/Application.myapp | 10 ++ .../My Project/AssemblyInfo.vb | 35 ++++++ .../My Project/Resources.Designer.vb | 62 +++++++++ .../MySQLPlayground/My Project/Resources.resx | 117 +++++++++++++++++ .../My Project/Settings.Designer.vb | 73 +++++++++++ .../My Project/Settings.settings | 7 ++ .../MySQLPlayground/MySQLPlayground.vbproj | 118 ++++++++++++++++++ .../MySQLPlayground/app.config | 9 ++ .../MySQLPlayground/packages.config | 4 + 12 files changed, 500 insertions(+) create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground.sln create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/Module1.vb create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.Designer.vb create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.myapp create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/AssemblyInfo.vb create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.Designer.vb create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.resx create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.Designer.vb create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.settings create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/MySQLPlayground.vbproj create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/app.config create mode 100644 COM350/ClassExamples/MySQLPlayground/MySQLPlayground/packages.config diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground.sln b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground.sln new file mode 100644 index 0000000..6f91054 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MySQLPlayground", "MySQLPlayground\MySQLPlayground.vbproj", "{89ECE613-DA56-43C1-A59D-7A8F092DADF0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {89ECE613-DA56-43C1-A59D-7A8F092DADF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89ECE613-DA56-43C1-A59D-7A8F092DADF0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89ECE613-DA56-43C1-A59D-7A8F092DADF0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89ECE613-DA56-43C1-A59D-7A8F092DADF0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/Module1.vb b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/Module1.vb new file mode 100644 index 0000000..d885af0 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/Module1.vb @@ -0,0 +1,32 @@ +Imports MySql.Data.MySqlClient + +Module Module1 + + Sub Main() + + Dim connectionString = "server=127.0.0.1;database=ad77260;uid=ad77260;pwd=90dd0e54;pooling=false;AllowZeroDateTime=True;" + Dim MysqlConn As MySqlConnection = New MySqlConnection(connectionString) + Try + Console.WriteLine("Attempting to open to {0}", connectionString) + MysqlConn.Open() + + Dim MySqlCommand As MySqlCommand = New MySqlCommand("Select * from com330_data", MysqlConn) + Dim dr As MySqlDataReader = MySqlCommand.ExecuteReader() + + If dr.HasRows Then + While dr.Read() + Console.WriteLine("{0}, {1}, {2}, {3}", dr(0), dr(1), dr(2), dr(3)) + End While + End If + + MysqlConn.Close() + MysqlConn.Dispose() + Catch ex As Exception + Console.WriteLine("Caught exception attempting to open mysqlconn") + End Try + + Console.ReadKey() + + End Sub + +End Module diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.Designer.vb b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.Designer.vb new file mode 100644 index 0000000..9faf70b --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34014 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.myapp b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.myapp new file mode 100644 index 0000000..e62f1a5 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 2 + true + diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/AssemblyInfo.vb b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..6bb8de9 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +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 + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' 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: +' + + + diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.Designer.vb b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.Designer.vb new file mode 100644 index 0000000..385adbf --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34014 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +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. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + 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("MySQLPlayground.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + 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 diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.resx b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.Designer.vb b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.Designer.vb new file mode 100644 index 0000000..2074816 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34014 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + 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 + + _ + 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 + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.MySQLPlayground.My.MySettings + Get + Return Global.MySQLPlayground.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.settings b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/MySQLPlayground.vbproj b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/MySQLPlayground.vbproj new file mode 100644 index 0000000..80a8e27 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/MySQLPlayground.vbproj @@ -0,0 +1,118 @@ + + + + + Debug + AnyCPU + {89ECE613-DA56-43C1-A59D-7A8F092DADF0} + Exe + MySQLPlayground.Module1 + MySQLPlayground + MySQLPlayground + 512 + Console + v4.0 + + + AnyCPU + true + full + true + true + bin\Debug\ + MySQLPlayground.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + MySQLPlayground.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + True + ..\packages\MySql.Data.6.9.6\lib\net40\MySql.Data.dll + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + \ No newline at end of file diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/app.config b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/app.config new file mode 100644 index 0000000..851b1a6 --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/app.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/packages.config b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/packages.config new file mode 100644 index 0000000..748707b --- /dev/null +++ b/COM350/ClassExamples/MySQLPlayground/MySQLPlayground/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file