Click here to Skip to main content
16,019,764 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have created a database layer and a business layer. I have created a function in the database layer and rebuild > added the dll in business layer > when I call the function in the business layer it is not calling.

The database layer coding where the function CheckReportData is not being created:
VB
Imports System.Globalization
Imports System.Collections

Imports System.Data.Common
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Care21.BaseFramework
Imports Care21.BusinessObjects
Imports Care21.Utilities

#End Region


Public Class ReportDB

Public Function CheckReportData(ByVal iMonth, ByVal iYear, ByVal iUserid) As Boolean
Dim ReturnCode As Boolean = False
Dim ReturnValues As New Dictionary(Of String, Object)
Dim result As Boolean

Try

Dim DbObject As Database = DatabaseFactory.CreateDatabase()
Dim DbCommand As DbCommand = DbObject.GetStoredProcCommand("usp_Rpt_InpatientReturns")

Data.AddInParameter(DbCommand, "@paMonthIn", DbType.String, iMonth, DbObject)
Data.AddInParameter(DbCommand, "@paYearIn", DbType.String, iYear, DbObject)
Data.AddInParameter(DbCommand, "@paUserIdIn", DbType.String, iUserid, DbObject)
Dim dt As DataTable
Dim ds As New DataSet("tt")

Dim DataReaderObject As IDataReader = DbObject.ExecuteReader(DbCommand)

dt.Load(DataReaderObject) 'If DataReaderObject.FieldCount = 0 Then
'Else

'End If
If dt.Rows.Count = 0 Then
result = False
Else
result = True

End If



DbCommand.Parameters.Clear()
'If ReturnValues("Result").ToString().Equals("1") Then
'Return True
'Else
' Return False
'End If
Catch ex As Exception
Throw
End Try
Return result
End Function

End Class

The business layer coding where I call the database layer function here:
VB
#Region "Imports"
 Imports Care21.Utilities
Imports Care21.BusinessObjects


Imports System.Globalization
Imports System.Data.Common
Imports System.Transactions

Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Care21.BaseFramework

Imports Care21.DataAccessLogic.RegistrationDB
#End Region

Public Class Report

#Region "Public Methods"
 Public Function CheckReportData(ByVal iMonth, ByVal iYear, ByVal iUserid) As Boolean
Dim DbObject As ReportDB = New ReportDB()
Return DbObject. 'The error is here where it supposed to come DbObject.CheckReportData, but only thing comes out is .ToString()
End Function

#End Region
End Class
Posted
Updated 28-May-15 20:50pm
v2
Comments
Mathi Mani 29-May-15 0:17am    
It is a code dump, and makes it difficult to see what the problems is. Please improve the question.
Tomas Takac 29-May-15 2:53am    
You are not referencing the correct dll. From your description it sounds like you are adding the resulting DAL dll into BLL references. These projects should be in one solution and you should use project references. This way you don't get version issues.
Member 11727014 29-May-15 3:17am    
I was told to create the class file in db layer, rebuild and add that files dll in business layer reference.
Tomas Takac 29-May-15 7:09am    
A new dll for a single class? This doesn't seem right. My previous advice still applies however, use project references. Otherwise check twice that you are referencing the correct dll and that it gets loaded.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900