Public Function GetEmployeeName(ByVal EmployeeNumber As String) As String 'Create and set the Connection and SQL Statement strings Dim ConnectionString As String Dim SelectStatement As String ConnectionString = "Provider=IBMDA400.DataSource.1;" & _ "User ID=UserID;Password=Password;Data Source=HostAddress;" SelectStatement = "Select EmpNam from Midrange.Employees where EmpNum = '" & _ EmployeeNumber.ToString() & "'" 'Establish a connection with the database Dim Connection As New Data.OleDb.OleDbConnection(ConnectionString) 'Establish the pipeline to the actual data Dim da As New Data.OleDb.OleDbDataAdapter(SelectStatement, Connection) 'Create a Dataset to hold the returned set of data Dim ds As New Data.DataSet() 'Fill the Dataset with data da.Fill(ds, "Employees") 'Extract the Employee Name from the result set and return to calling Web Service 'Client GetEmployeeName = ds.Tables("Employees").Rows(0).Item("EmpNam") End Function