Mysql class Database Settings Connection
Imports System.Configuration
Public Class DS_frmDatabaseSettings
Private Sub btnTestConnection_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTestConnection.Click
Dim strErrMsg As String = String.Empty
Dim RptString As String = String.Empty
Try
MySQLDBAccess.connectionString = "server = " & txtServer.Text & ";" _
& "user id = " & txtUserID.Text & ";" _
& "password = " & txtPassword.Text & ";" _
& "database = " & txtDatabase.Text
MySQLDBAccess.TestMySQLDBConnection(strErrMsg)
If strErrMsg = String.Empty Then
'Write DB Connection Setting to app.config
WriteDBConfig(MySQLDBAccess.connectionString)
MessageBox.Show("Test connection successful.", "DiabNet DB Connection", MessageBoxButtons.OK, MessageBoxIcon.Information)
btnOK.Enabled = True
Else
MessageBox.Show(strErrMsg, "TEST DB Connection", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Catch ex As Exception
DBL_PRINTLOG("DS_frmDatabaseSettings::btnTestConnection_Click() Exception >> " & ex.Message)
End Try
End Sub
REM Write DB Connection Setting to app.config
Private Sub WriteDBConfig(ByVal strConnString As String)
' Open app.config of executable
Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
If ConfigurationManager.AppSettings.HasKeys() Then
' Clear key list
config.AppSettings.Settings.Clear()
End If
' Add application setting
config.AppSettings.Settings.Add("MySQLConnString", strConnString)
config.AppSettings.Settings.Add("Server", txtServer.Text)
config.AppSettings.Settings.Add("UserID", txtUserID.Text)
config.AppSettings.Settings.Add("Password", txtPassword.Text)
config.AppSettings.Settings.Add("Database", txtDatabase.Text)
' Save the configuration file
config.Save(ConfigurationSaveMode.Modified)
' Force reload of changed section
ConfigurationManager.RefreshSection("appSettings")
End Sub
REM Read DB Connection Settings from app.config
Private Function ReadDBConfig(ByVal strKey As String) As String
Dim strKeyValue As String = String.Empty
Dim bKeyFound As Boolean = False
If ConfigurationManager.AppSettings.HasKeys() Then
For nKeyIndex As Integer = 0 To (ConfigurationManager.AppSettings.Keys.Count - 1)
If ConfigurationManager.AppSettings.GetKey(nKeyIndex) = strKey Then
strKeyValue = ConfigurationManager.AppSettings(strKey)
bKeyFound = True
Exit For
End If
Next
End If
Return strKeyValue
End Function
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
MySQLDBAccess.connectionString = "server = " & txtServer.Text & ";" _
& "user id = " & txtUserID.Text & ";" _
& "password = " & txtPassword.Text & ";" _
& "database = " & txtDatabase.Text
WriteDBConfig(MySQLDBAccess.connectionString)
Me.Hide()
End Sub
Private Sub DS_frmDatabaseSettings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Retrieve DB Connection Settings from app.config
txtServer.Text = ReadDBConfig("Server")
txtUserID.Text = ReadDBConfig("UserID")
txtPassword.Text = ReadDBConfig("Password")
txtDatabase.Text = ReadDBConfig("Database")
btnOK.Enabled = False
End Sub
End Class
connect vb2008 to a mysql database a Public Class MySQLDBAccess
Imports MySql.Data.MySqlClient
Imports System.Configuration
Public Class MySQLDBAccess
#Region "Private Shared Variables"
Private Shared mySqlConnString As String = String.Empty 'MySQL Connection String
Private Shared mySqlConn As New MySqlConnection 'MySQL Connection
Private Shared mySqlCommand As New MySqlCommand 'MySQL Command
Private Shared mySqlDataAdapter As New MySqlDataAdapter 'MySQL Data Adapter
Private Shared mySqlDataReader As MySqlDataReader 'MySQL Data Reader
#End Region
#Region "Public Shared Properties"
Public Shared Property connectionString() As String
Get
Return mySqlConnString
End Get
Set(ByVal value As String)
mySqlConnString = value
End Set
End Property
#End Region
#Region "Public Shared Functions"
'For Testing Database Connection
Public Shared Sub TestMySQLDBConnection(ByRef strErrMsg As String)
Try
mySqlConn = New MySqlConnection()
mySqlConn.ConnectionString = mySqlConnString
mySqlConn.Open()
mySqlConn.Close()
Catch ex As Exception
strErrMsg = "Cannot connect to DiabNet database."
DBL_PRINTLOG("MySQLDBAccess::TestMySQLDBConnection() >> " & ex.Message)
End Try
End Sub
'For SELECT procedures without parameters
Public Shared Function ExecuteCommand(ByVal mySqlQuery As String, ByRef strErrMsg As String) As DataTable
Dim dtDataTable As New DataTable
TestMySQLDBConnection(strErrMsg)
If strErrMsg = String.Empty Then
Try
mySqlConn = New MySqlConnection()
mySqlCommand = New MySqlCommand()
mySqlConn.ConnectionString = mySqlConnString
mySqlConn.Open()
mySqlCommand.Connection = mySqlConn
mySqlCommand.CommandText = mySqlQuery
mySqlDataAdapter.SelectCommand = mySqlCommand
mySqlDataAdapter.Fill(dtDataTable)
mySqlConn.Close()
Catch mySqlEx As MySqlException
strErrMsg = mySqlEx.Message
DBL_PRINTLOG("MySQLDBAccess::ExecuteCommand() MySQLException >> " & strErrMsg)
Catch ex As Exception
strErrMsg = ex.Message
DBL_PRINTLOG("MySQLDBAccess::ExecuteCommand() Exception >> " & strErrMsg)
Finally
mySqlConn.Dispose()
End Try
End If
Return dtDataTable
End Function
'For SELECT procedures with parameters
Public Shared Function ExecuteCommand(ByVal mySqlQuery As String, ByVal htMySqlParameters As Hashtable, ByRef strErrMsg As String) As DataTable
Dim dtDataTable As New DataTable
TestMySQLDBConnection(strErrMsg)
If strErrMsg = String.Empty Then
Try
mySqlConn = New MySqlConnection()
mySqlCommand = New MySqlCommand()
mySqlConn.ConnectionString = mySqlConnString
mySqlCommand.Connection = mySqlConn
mySqlCommand.CommandText = mySqlQuery
Dim ideEnumerator As IDictionaryEnumerator = htMySqlParameters.GetEnumerator()
While ideEnumerator.MoveNext
mySqlCommand.Parameters.Add("?" & ideEnumerator.Key, ideEnumerator.Value)
End While
mySqlConn.Open()
mySqlDataAdapter.SelectCommand = mySqlCommand
mySqlDataAdapter.Fill(dtDataTable)
mySqlConn.Close()
Catch mySqlEx As MySqlException
strErrMsg = mySqlEx.Message
DBL_PRINTLOG("MySQLDBAccess::ExecuteCommand() MySQLException >> " & strErrMsg)
Catch ex As Exception
strErrMsg = ex.Message
DBL_PRINTLOG("MySQLDBAccess::ExecuteCommand() Exception >> " & strErrMsg)
Finally
mySqlConn.Dispose()
End Try
End If
Return dtDataTable
End Function
'For INSERT, UPDATE, and DELETE PROCEDURES
Public Shared Sub ExecuteCommand(ByVal mySqlQuery As String, ByVal htMySqlParameters As Hashtable, ByVal nTransType As Integer, ByRef strErrMsg As String)
Dim nRowsAffected As Integer = 0
TestMySQLDBConnection(strErrMsg)
If strErrMsg = String.Empty Then
Try
mySqlConn = New MySqlConnection()
mySqlCommand = New MySqlCommand()
mySqlConn.ConnectionString = mySqlConnString
mySqlCommand.Connection = mySqlConn
mySqlCommand.CommandText = mySqlQuery
Dim ideEnumerator As IDictionaryEnumerator = htMySqlParameters.GetEnumerator()
While ideEnumerator.MoveNext
mySqlCommand.Parameters.Add("?" & ideEnumerator.Key, ideEnumerator.Value)
End While
mySqlConn.Open()
nRowsAffected = mySqlCommand.ExecuteNonQuery()
' Transaction Types
' 1 - Insert, 2 - Update, 3 - Delete
If nRowsAffected = 0 Then
If nTransType = 1 Then
strErrMsg = "MySQLDBAccess::ExecuteCommand()::Insert Record Failed"
ElseIf nTransType = 2 Then
strErrMsg = "MySQLDBAccess::ExecuteCommand()::Update Record Failed"
ElseIf nTransType = 3 Then
strErrMsg = "MySQLDBAccess::ExecuteCommand()::Delete Record Failed"
End If
DBL_PRINTLOG(strErrMsg)
End If
mySqlConn.Close()
Catch mySqlEx As MySqlException
strErrMsg = mySqlEx.Message
DBL_PRINTLOG("MySQLDBAccess::ExecuteCommand() MySQLException >> " & strErrMsg)
Catch ex As Exception
strErrMsg = ex.Message
DBL_PRINTLOG("MySQLDBAccess::ExecuteCommand() Exception >> " & strErrMsg)
Finally
mySqlConn.Dispose()
End Try
End If
End Sub
#End Region
Fuel Station
Title:Fuel Station
A.The software should be capable to add, retrieve, update, delete, cancel, save, and print the following:
1.Fuel Sales
=>Fuel Receipts,Fuel Dippings,Daily Metre Redings,Coupon Sales
2.Customer Transactions
=>Fuel Credit Sales,Lube Credit Sales,Customer Payments,Other Services,Customer Registration,Customer Opening Balance
3.Supplier Transaction
s=>Fuel Order,Fuel Received,Fuel Diversions,My Opening Balance
4.Other Transactions=>Usage,Expenditure
5.Reports
=>Fuel Sales,Credit Sales,Fuel Received,Coupon Sales,Supplier Transactions,Expenditure and Fuel Usage
6.Program Setup
=>Tank Registration,Pump Registration,Register Attendants,Change Fuel Rate,Change Lube Rate,Lube Registration,Transacting Stations,Register Coupons Denominations,User egistration
7.System Backup
B.The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: MS ACCESs
Programming Languages: VB.6.0
Download
Payroll System
Title:Payroll System
A.The software should be capable to add, retrieve, update, delete, cancel, save, and print the following:
1.DTR
2.AbsentStatus
3.Deparment Position
4.Employee Info
5.Employee Tax with Dependents
6.Exemption
7.Head of the Family Tax w/o Dependent Setup
8.Married Employee Tax w/o Dependent Setup
9.Payroll Period Setup
10.PHIL HEATLH Premium Schedule Setup
11.Department Setup
12.Shift Schedule Setup
13.SSS Premium Schedule Setup
14.DTR Validation
15.Generated Period Work Time
16.Loans & Charges
17.Access Type Setup
18.User Access Module
19.Reports
B.The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: MS ACCESs
Programming Languages: VB.6.0
Assa General Merchandise
Title:Assa General Merchandise . Toril, Davao City Philippines
Description: General Merchandise Software
a. The software should be capable to add, retrieve, update, delete, cancel, save, and print the following.
1.) Information => Supplier Information, Product Information, Customers Information, Collector’s Information, Pricing, Products Assembly
2.) Transactions => Purchased Orders, Loans, Cash / Credit Sales, Statement of Accounts
Payments => Purchased Orders, Loans, Credit Sales
Cash Collections => Credit Sales, Loans
3.) Inventory => Receiving Reports, Stock Transfers, Return to Supplier, Return from Customers, Lost Items, Damage Items, Stock Withdrawals, and Stock On Hand, Inventory Status.
4.) Cash Flow Management => Sales Reports , Petty Cash Fund , Check Vouchers , Cash Vouchers , Cash Collections , Cash/ Check Deposits ,Suppliers Ledger , Accounts Aging ,Accounts Payables , Accounts Receivables , Income Statement.
Customer Ledger => Loans, Credit Sales
Accounts Due => Suppliers, Customers
5.) System => Setting
Users => Add, Delete, Update
b. The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: Open Source provider MYSQL Server
Programming Language: VB.6.0, Convert to VB.NET, VB 2005 for the Future References
Reports : Crystals Reports 10
For more information:
http://gregfox.co.nr
http://keypress.co.nr
Email:gregfox_0681@yahoo.com
Library Monitoring System
Title:Library Monitoring System
a. The software should be capable to add, retrieve, update, delete, cancel, save, and print the following:
1.Book Information
2.Barrower's Information
b. The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: MS ACCESs
Programming Languages: VB.6.0
Download
This file came from http://gregfox.co.nr
Please make Donate your Click to Ads at Google Adsense
Thank you!
The author may have retained certain copyrights to this code...please observe their request and the law by reviewing all copyright conditions at the above URL.
Hospital Management
Title:Hospital Management
A.The software should be capable to add, retrieve, update, delete, cancel, save, and print the following:
1.Doctor Details
=>Add Doctors,Dispaly Doctors,Search Doctors
2.Hospital Services
=>Add Hospital Service,Display Hospital Services,Search Hospital Services
3.Backup Database
4.Patients
=>Out Patients,Out Patient Details,Add New Patient,View All
5.Docotor Appointment
=>Add Doctor Appointments,Cancel Doctor Appointment,Search Doctor Appointment
6.Service Appointments
=>Add Service Appointment,Cancel Service Appointment,Search Service Appointment
7.Patient Prescription
=>Add Prescription,View Patient History
8.Bill Payments
=>View Doctor Appointment Patient Bill,View Service Appointment Patient Bill
9.In Patients
=>Admision,Add Patient Details,Add Guardian Details,Registration,View Admission List
10.Treatments
=>Add Doctor Visits,View Doctor Visits,Add Medicinal Details,View Medicinal Details,Add Service Details,View Service Details>Discharge,Discharge PatientView Discharge List
11.Bill Payments>View Patient Bill,Edit Patient Bill,Add New Payment,Search Payment
12.Management
=>Hopital Management,Doctor Management,Doctor Schedule,Hospital Service Management,Service Scehdule,Room Management,Add New Room,View Rooms,Add Room Type,Ward Management,Add New Ward,View Ward Details,Bed Management,Add Bed Details,Bed Avaiabilty
13.Pharmacy Management
=>Sale,Invoice,Customers,Purchases,Purchase Invoice,Products,Categories,Suppliers
14.Employee Management
=>Add Employee Details,Employee Salary Calculation,Doctor Salary Calculation,Add Departments
15.Reports
=>Managerial Reports,Patient Report,In Patient Medicine Issue,In Patient Medical Services,In Patient Doctor Visits,Hospital Reports,Room Report,Ward Report,Bed Reports,Medical Services Schedule,Doctor Shedule
16.Pharmacy Reports
=>Sales,Purchases,Customers,Employee Reports
B.The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: MS ACCESs
Programming Languages: VB.6.0
Download
Accounting System Softwar
Title:Meter King Incorporated .16 Tipulo St. 10 Baloy Tablon, Cagayan City Philippines
Description: Accounting System Software.
a. The software should be capable to add, retrieve, update, delete, cancel, save, and print the following:
1.) Information => Supplier Information, Product Information, Customers Information, Collector’s Information, Pricing, Products Assembly.
2.) Transactions => Purchased Orders, Loans, Cash / Credit Sales, Statement of Accounts
Payments => Purchased Orders, Loans, Credit Sales
Cash Collections => Credit Sales, Loans
3.) Inventory => Receiving Reports, Stock Transfers, Return to Supplier, Return from Customers, Lost Items, Damage Items, Stock Withdrawals, and Stock On Hand, Inventory Status.
4.) Cash Flow Management => Sales Reports , Petty Cash Fund , Check Vouchers , Cash Vouchers , Cash Collections , Cash/ Check Deposits ,Suppliers Ledger , Accounts Aging ,Accounts Payables , Accounts Receivables , Disbursement Vouchers Recapitalization , Income Statement.
Customer Ledger => Loans, Credit Sales
Accounts Due => Suppliers, Customers
5.) System => Setting, Account Codes
Users => Add, Delete, Update
b. The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: Open Source provider MYSQL Server
Programming Languages: VB.6.0, Convert to VB.NET, VB 2005 for the Future References
Reports : Crystals Reports 10
Download1
Download2
Download3
Download4
Download5
For more information:
http://gregfox.co.nr
http://keypress.co.nr
Email:gregfox_0681@yahoo.com
Accounting System Software
Accounting System Software.
a. The software should be capable to add, retrieve, update, delete, cancel, save, and print the following:
1.) Information => Supplier Information, Product Information, Customers Information, Collector’s Information, Pricing, Products Assembly.
2.) Transactions => Purchased Orders, Loans, Cash / Credit Sales, Statement of Accounts
Payments => Purchased Orders, Loans, Credit Sales
Cash Collections => Credit Sales, Loans
3.) Inventory => Receiving Reports, Stock Transfers, Return to Supplier, Return from Customers, Lost Items, Damage Items, Stock Withdrawals, and Stock On Hand, Inventory Status.
4.) Cash Flow Management => Sales Reports , Petty Cash Fund , Check Vouchers , Cash Vouchers , Cash Collections , Cash/ Check Deposits ,Suppliers Ledger , Accounts Aging ,Accounts Payables , Accounts Receivables , Disbursement Vouchers Recapitalization , Income Statement.
Customer Ledger => Loans, Credit Sales
Accounts Due => Suppliers, Customers
5.) System => Setting, Account Codes
Users => Add, Delete, Update
b. The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.
Data source Provider: Open Source provider MYSQL Server
Programming Languages: VB.6.0, Convert to VB.NET, VB 2005 for the Future References
Reports : Crystals Reports 10
odbc:mysql connector
Download1
Download2
Download3
Download4
DataBase
For more information:
http://gregfox.co.nr
http://keypress.co.nr
Email:gregfox_0681@yahoo.com
Insurance Monitoring System
Title:Insurance Monitoring System
Description:
a. The software should be capable to add, retrieve, update, delete, cancel, save, and print the following.
1. Information
=>Insurance Providers, Policy Providers, Registration, Affidavits
2. Transaction
=> Billing, Claim
3. Reports
=> Daily Sales, Monthly Sales, Remittances, Commission, Sales vs. Claims, List of all Vehicles , List of Insurance Individuals, The Insured and Vehicles, List of Providers and Policies, Pending Accounts, etc.
4. System Tools
=> Managed the Insured, Managed the Vehicles, System Restore
System Security => Add User, Update User, Delete User, View Logs
Data source Provider: MS ACCESS
Programming Languages: VB.6.0, Convert to VB.NET, VB 2005 for the Future References
Reports : Crystals Reports 10
Download1
Download2
Download3
Download4
Download5
Document Download
For more information:
http://gregfox.co.nr
http://keypress.co.nr
Email:gregfox_0681@yahoo.com
General Merchandise
a. The software should be capable to add, retrieve, update, delete, cancel, save, and print the following.1.) Information => Supplier Information, Product Information, Customers Information, Collector’s Information, Pricing, Products Assembly2.) Transactions => Purchased Orders, Loans, Cash / Credit Sales, Statement of Accounts Payments => Purchased Orders, Loans, Credit SalesCash Collections => Credit Sales, Loans3.) Inventory => Receiving Reports, Stock Transfers, Return to Supplier, Return from Customers, Lost Items, Damage Items, Stock Withdrawals, and Stock On Hand, Inventory Status.4.) Cash Flow Management => Sales Reports , Petty Cash Fund , Check Vouchers , Cash Vouchers , Cash Collections , Cash/ Check Deposits ,Suppliers Ledger , Accounts Aging ,Accounts Payables , Accounts Receivables , Income Statement. Customer Ledger => Loans, Credit Sales Accounts Due => Suppliers, Customers 5.) System => Setting Users => Add, Delete, Update b. The software can be installed on different computers and should be able to communicate synchronously, provided that the computers are on a Local Area Network and that the hardware.Data source Provider: Open Source provider MYSQL ServerProgramming Language: VB.6.0, Convert to VB.NET, VB 2005 for the Future ReferencesReports : Crystals Reports 10
Concat for Mysql Database FullName to Display
You will have to concatenate the data as Full Name to Display
Create a formulas as follows:
concat(`patient`.`PatientLastName`,_latin1', ',`patient`.`PatientFirstName`,_latin1' ',`patient`.`PatientMiddleName`)
Concat for Crystal Report FullName
You will have to concatenate the data as it is read and report it in the group footer. Create a formulas as follows:
StringVar ConCat;
ConCat +({vieweducatorclientlist.PatientLastName}) + ", "+ ({vieweducatorclientlist.PatientFirstName})+ " "+({vieweducatorclientlist.PatientMiddleName})