Shared functions in DAL

  • Thread starter Thread starter milop
  • Start date Start date
M

milop

Hello.

I'm using a three tiered architecture (UI, BLL, DAL) in an ASP.Net
application.

The functions in the DAL are shared functions, while the BLL's are not.

What are the ramifications, if any, of using Shared functions in the DAL?

Is there an exposure of "data sharing" from the DAL to the BLL?

Thanks in advance,

Mike
 
milop said:
Hello.

I'm using a three tiered architecture (UI, BLL, DAL) in an ASP.Net
application.

The functions in the DAL are shared functions, while the BLL's are not.

What are the ramifications, if any, of using Shared functions in the DAL?

Is there an exposure of "data sharing" from the DAL to the BLL?

Thanks in advance,

Can you give an example of this shared function you are talking about?
 
Public Shared Function GetSomeData(ByVal InputField As Int32) As
DataTable
Try
Using cn As New
iDB2Connection(ConfigurationManager.ConnectionStrings("iSeries").ConnectionString)
Using cm As New iDB2Command
cm.CommandText = "GetSomeData"
cm.CommandType = CommandType.StoredProcedure
cn.Open()
cm.Connection = cn
cm.DeriveParameters()
cm.Parameters("@InputField").Value = InputField
Dim dt as New DataTable()
Using da as New IDB2DataAdapter(cm)
da.Fill(dt)
End Using
ThrowException(cm, Nothing) ' Custom method that
examines returned error info.
Return dt
End Using
End Using

Catch Critical As CriticalException
Throw

Catch Severe As SevereException
Throw

Catch Warning As WarningException
Throw

Catch ex As Exception
SupportEmail.SendEmail("Exception caught in blah, blah,
blah", ex.ToString())
Throw New CriticalException()

End Try
End Function
 
You're right, and I have the Enterprise Library installed. I'll have a look.

I posted some code in response to Mr. Arnold's response.

Thanks, Sloan.
 
Back
Top