Click here to Skip to main content
13,357,648 members (62,172 online)

Comments by Simeon Abiodun (Top 18 by date)

Simeon Abiodun 22-Sep-14 6:05am View
   
I wish to connect with you on social network (facebook)
Simeon Abiodun 22-Sep-14 5:40am View
   
Yeah! Thanks, it`s working perfectly now.
Simeon Abiodun 20-Sep-14 3:15am View
   
Public Sub updateEmpNo(ByVal xxxx As String, ByVal yyyy As String, ByVal cmbCompDesc As String)

Dim strcmd As String = "Insert into EmployeeMaster(Emp_EmployeeNumber,Emp_Surname,Emp_FirstName,Emp_OtherNames,Emp_Title,Emp_Gender,Emp_OfficePhoneExtension,Emp_YearsInService,Emp_DefaultHours,Emp_Status,Emp_DepartmentCode,Emp_DivisionCode,Emp_SectionCode,Emp_BranchCode,Emp_RegionCode,Emp_LocationCode,Emp_ReportTo,Emp_JobCode,Emp_ClassCode,Emp_PositionCode,Emp_Group1Code,Emp_Group2Code,Emp_Group3Code,Emp_EmploymentDate,Emp_EffectiveDate,Emp_EmploymentType,Emp_ReasonForChange,Emp_LastChangedBy,Emp_DateofChange,Emp_AlternateNumber1,Emp_PayPending) " & _
"Select @py,Emp_EmployeeNumber,Emp_Surname,Emp_FirstName,Emp_OtherNames,Emp_TitleEmp_Gender,Emp_OfficePhoneExtension,Emp_YearsInService,Emp_DefaultHours,Emp_Status,Emp_DepartmentCode,Emp_DivisionCode,Emp_SectionCode,Emp_BranchCode,Emp_RegionCode,Emp_LocationCode,Emp_ReportTo,Emp_JobCode,Emp_ClassCode,Emp_PositionCode,Emp_Group1Code,Emp_Group2Code,Emp_Group3Code,Emp_EmploymentDate,Emp_EffectiveDate,Emp_EmploymentType,Emp_ReasonForChange,Emp_LastChangedBy,Emp_DateofChange,Emp_AlternateNumber1,Emp_PayPending where Emp_EmployeeNumber= @px " & _
"update employeeBenefits set EmployeeNo=@py where EmployeeNo=@px; " & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber=@px; " & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber=@px; " & _
"update EmployeeConfirmation set Econfirmation_EmployeeNumber=@py where Econfirmation_EmployeeNumber=@px; " & _
"update EmployeeContact set EContact_EmployeeNumber=@py where EContact_EmployeeNumber=@px; " & _
"update EmployeeAbsence set EAbsence_EmployeeNumber=@py where EAbsence_EmployeeNumber=@px; " & _
"update EmployeeAccidentHist set EAccidHist_EmployeeNumber=@py where EAccidHist_EmployeeNumber=@px; " & _
"update EmployeeAppraisal set EAppraisal_EmployeeNumber=@py where EAppraisal_EmployeeNumber=@px; " & _
"update EmployeeAttachment set EmpAttach_EmployeeNumber=@py where EmpAttach_EmployeeNumber=@px; " & _
"update EmployeeAttendance set EAttendance_EmployeeNumber=@py where EAttendance_EmployeeNumber=@px; " & _
"update EmployeeBackgroundCheck set ECheck_EmployeeNumber=@py where ECheck_EmployeeNumber=@px; " & _
"update employeeBenefits set EmployeeNo=@py where EmployeeNo=@px; " & _
"update EmployeeBank set EBank_EmployeeNumber=@py where EBank_EmployeeNumber=@px; " & _
"update EmployeeDeduction set EDed_EmployeeNumber=@py where EDed_EmployeeNumber=@px; " & _
"update EmployeeDependantRelatives set ERelative_EmployeeNumber=@py where ERelative_EmployeeNumber=@px; " & _
"update EmployeeEducation set EEduc_EmployeeNumber=@py where EEduc_EmployeeNumber=@px; " & _
"update EmployeeEmergencyAddress set EEmergAddr_EmployeeNumber=@py where EEmergAddr_EmployeeNumber=@px; " & _
"update EmployeeLoan set ELoan_EmployeeNumber=@py where ELoan_EmployeeNumber=@px; " & _
"update EmployeeLoan_Termination set Eloan_EmployeeNumber=@py where Eloan_EmployeeNumber=@px; " & _
"update EmployeeLoanDetails set ELoan_EmployeeNumber=@py where ELoan_EmployeeNumber=@px; " & _
"update EmployeeMedicalHistory set EMedHist_EmployeeNumber=@py where EMedHist_EmployeeNumber=@px; " & _
"update EmployeeMedInfo set EMedInfo_EmployeeNumber=@py where EMedInfo_EmployeeNumber=@px; " & _
"update EmployeeNextofKin set ENextKin_EmployeeNumber=@py where ENextKin_EmployeeNumber=@px; " & _
"update EmployeeNHF set EmpNHF_EmployeeNumber=@py where EmpNHF_EmployeeNumber=@px; " &
Simeon Abiodun 20-Sep-14 3:13am View
   
It further throw the sqlexception error:
An expression of non-boolean type specified in a context where a condition is expected, near ';'.

I`m sorry for disturbing u all d while.
Thanks
Simeon Abiodun 19-Sep-14 16:55pm View
   
I will do likewise...
Simeon Abiodun 19-Sep-14 16:38pm View
   
Public Function getCompID(ByVal compDesc As String) As String
Dim sql As String = "Select (CompanyID) from CompanyDatabases where Description= '" & compDesc & "' "
Dim con As New SqlConnection
Dim cmd As New SqlCommand(sql, con)
Dim company As String
con.ConnectionString = connString()
con.Open()
company = cmd.ExecuteScalar()
cmd.Dispose()
con.Dispose()
Return company
End Function

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim myEngine As New databaseConnect
Dim drpBox As New DropDownList
myEngine.fetchCompany(drpBox, drpbxCompany, lblMsg)

End If
End Sub

Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Dim engine As New databaseConnect

' Dim company As String
'company = engine.getCompID(drpCompany.Text)

engine.updateEmpNo(txtOldEmpNO.Text, txtNewEmpNo.Text, engine.getCompID(drpbxCompany.Text))
lblMsg.Text = "Record updated Succcessfully"
End Sub

I`m using MS sql server 2012.

Thanks
Simeon Abiodun 19-Sep-14 16:25pm View
   
Public Sub updateEmpNo(ByVal xxxx As String, ByVal yyyy As String, ByVal cmbCompDesc As String)

Dim strcmd As String = "Insert into EmployeeMaster" & _
"@py" & _
"select Emp_Surname from EmployeeMaster where Emp_EmployeeNumber=@px" & _
"select Emp_FirstName from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_OtherNames from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Title from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Gender from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_OfficePhoneExtension from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_YearsInService from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DefaultHours from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Status from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DepartmentCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DivisionCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_SectionCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_BranchCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_RegionCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_LocationCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_ReportTo from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_JobCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_ClassCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_PositionCode from EmployeeMaster where Emp_EmployeeNumber=@px" & _
"select Emp_Group1Code from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Group2Code from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Group3Code from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_EmploymentDate from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_EffectiveDate from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_EmploymentType from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_ReasonForChange from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_LastChangedBy from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DateofChange from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_AlternateNumber1 from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_PayPending from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"update employeeBenefits set EmployeeNo=@py where EmployeeNo=@px" & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber=@px" & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber= @px" & _
"update EmployeeConfirmation set Econfirmation_EmployeeNumber=@py where Econfirmation_EmployeeNumber= @px" & _
"update EmployeeContact set EContact_EmployeeNumber=@py where EContact_EmployeeNumber= @px" & _
"update EmployeeAbsence set EAbsence_EmployeeNumber=@py where EAbsence_EmployeeNumber= @px" & _
"update EmployeeAccidentHist set EAccidHist_EmployeeNumber=@py where EAccidHist_EmployeeNumber= @px" & _
"update EmployeeAppraisal set EAppraisal_EmployeeNumber=@py where EAppraisal_Empl
Simeon Abiodun 19-Sep-14 16:20pm View
   
Deleted
Public Sub updateEmpNo(ByVal xxxx As String, ByVal yyyy As String, ByVal cmbCompDesc As String)

Dim strcmd As String = "Insert into EmployeeMaster" & _
"@py" & _
"select Emp_Surname from EmployeeMaster where Emp_EmployeeNumber=@px" & _
"select Emp_FirstName from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_OtherNames from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Title from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Gender from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_OfficePhoneExtension from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_YearsInService from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DefaultHours from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Status from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DepartmentCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DivisionCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_SectionCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_BranchCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_RegionCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_LocationCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_ReportTo from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_JobCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_ClassCode from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_PositionCode from EmployeeMaster where Emp_EmployeeNumber=@px" & _
"select Emp_Group1Code from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Group2Code from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_Group3Code from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_EmploymentDate from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_EffectiveDate from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_EmploymentType from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_ReasonForChange from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_LastChangedBy from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_DateofChange from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_AlternateNumber1 from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"select Emp_PayPending from EmployeeMaster where Emp_EmployeeNumber= @px" & _
"update employeeBenefits set EmployeeNo=@py where EmployeeNo=@px" & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber=@px" & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber= @px" & _
"update EmployeeConfirmation set Econfirmation_EmployeeNumber=@py where Econfirmation_EmployeeNumber= @px" & _
"update EmployeeContact set EContact_EmployeeNumber=@py where EContact_EmployeeNumber= @px" & _
"update EmployeeAbsence set EAbsence_EmployeeNumber=@py where EAbsence_EmployeeNumber= @px" & _
"update EmployeeAccidentHist set EAccidHist_EmployeeNumber=@py where EAccidHist_EmployeeNumber= @px" & _
"update EmployeeAppraisal set EAppraisal_EmployeeNumber=@py where EAppraisal_
Simeon Abiodun 19-Sep-14 16:08pm View
   
I have an employee which was assign a wrong employee number, I want to change the employee number to the new one. yyyy is the new while xxxx depicts the old one. Due to how the tables are related, I cannot update the old employee number being the primary key upon which all other tables within the application depends on. So I thought of creating a new employee with correct employee number and select all the data from the old one into the new one. Then later update every other tables with the current employee number, and finally delete the old employee number.
With the sql script I generated it work exactly as I want.
To avoid the stress of going to the back end database server to run the scripts, I decided to write a simple Asp.net web application that will prompt the user to select specified database from drop down box and supply both old and new employee number and with a click of button, the task be done.
The code is shown below.
Simeon Abiodun 18-Sep-14 18:33pm View
   
I need an heelping hand to this regard.
Thanks.
Simeon Abiodun 18-Sep-14 18:31pm View
   
it throw d exception error as shown below.

Server Error in '/lEAD' Application.
--------------------------------------------------------------------------------

Incorrect syntax near the keyword 'distinct'.
Incorrect syntax near '@px'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'distinct'.
Incorrect syntax near '@px'.

Source Error:


Line 202: cmd.Parameters.AddWithValue("@py", yyyy)
Line 203: cmd.Parameters.AddWithValue("@px", xxxx)
Line 204: cmd.ExecuteNonQuery()
Line 205: End Using
Line 206: End Using


Source File: C:\Users\Dev02\Documents\Visual Studio 2008\WebSites\lEAD\App_Code\databaseConnect.vb Line: 204
Simeon Abiodun 17-Sep-14 16:59pm View
   
The question is right their but for clarification, I just want to know how I`m going to pass the script into a query withing a declared method.

Public Sub editEmployeeNumber(ByVal yyyy As String, ByVal xxxx As String)
Dim conn As SqlConnection
Dim cmd As SqlCommand
conn.ConnectionString = getVHRSConstring()
conn.Open()
Dim query As String = "MY SQL SCRIPTS"
cmd = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
End Sub
vb.net does not recognize all these go statement of a thing it throw a lot of errors.
So How do I handle the script from vb.net environment.
Hope you understand me well now.
Simeon Abiodun 21-Aug-14 6:56am View
   
Thanks; the work is done. Kudos to CodeProject comunity
Simeon Abiodun 20-Aug-14 10:41am View
   
Yeah! thanks, can you please shed more light on how I can implement it from Vb.net code. I mean from the event handler selected index change of the combo box that fetch out all the database name.
Simeon Abiodun 9-Jul-12 0:52am View
   
Thanks dad. Can I get a link to Apache qpid?
Simeon Abiodun 4-Jul-12 10:09am View
   
I have 2 questions sir,
(1) How can I develop myself as a young developer.
(2) I really want to write an application (c#) that can synchronise beteween two database server in a form of failover cluster.
I want to make it as my undergraduate project.
Simeon Abiodun 4-Jul-12 9:48am View
   
Thanks, the link provided helps alot, I will see to them all criticaly.
Simeon Abiodun 4-Jul-12 9:09am View
   
I talking of Database Server.

Advertise | Privacy |
Web02 | 2.8.180111.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid