Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed for using SQLParameter Array in N-tier environment

Status
Not open for further replies.

Teamgc

Programmer
Feb 15, 2006
37
IE
Hi

I am working on an n-tier system (WCF Services). I have a Data Access Layer (DAL), Business Object Layer (BOL), a Product Business Object Layer (ProdBOL) which are consumed by my application.

I want to pass an array of SQLParameters from my application all the way to the DAL and return a Dataset but I get the error saying I cannot serialise an array of SQLParameters.

Does anyone know any good examples of doing something similar to this?

thanks
 
I think you have a design problem.

you should in no case (whatsoever) be passing parameters to the DAL, you do not have an n-tiered system if you do. Pass objects (Domain entities).

Christiaan Baes
Belgium

My Blog
 
So I should be passing an object. So I should have a data object that the BOL passes to the DAL?
 
i've added the following class to my DAL

Public Class DALParameter
Private m_SQL As String
Private m_parameter() As String
Private m_Datatype as SQLDbtype
End Class

I populate the class at the front end and get it all the way back to the DAL but I cannot set the Parameter Datatype. It keeps setting it to bigint as if the object is empty.

can anyone shed any light on this?
 
An object from you BLL should not have any, ANY reference to system.data namespace. SQLDbType is clearly located in the system.data namespace.



Christiaan Baes
Belgium

My Blog
 
Here's my issue.

I have a ProductBOL, A Generic BOL, A DAL

My Presentation Layer passes a class to my BOL, which in turn takes this class and using the generic BOL puts it in a form to pass to the DAL.

The DAL then puts it into the database.

My problem is that my DAL has to use deriveparameters to find out the datatype of my parameters but I don't want to have to do this call to the DB.

Is there a better way of doing this?
 
My cristal ball is broken so could you give us some code.

you think you have a DAL, you think you have a BOL. But perhaps you don't.



Christiaan Baes
Belgium

My Blog
 
It turns out I was trying to be too generic. thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top