Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where put SQL in DataAccess Class?
Message
From
29/01/2004 17:04:33
Del Despain
Colorado Plateau Associates
Hurricane, Utah, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00871117
Message ID:
00872082
Views:
18
Thanks Kevin!

Del

>OK...here it is:
>
>MM .NET data access classes give you a variety of choices as to where you place your SQL statements:
>
>1. You can place the SQL statements in the data access class. If you do this, I recommend using a bridge pattern. For example, you could create a method on the business object named "GetOrdersByCustomerID", and create a corresponding method on the data access object named "GetOrdersByCustomerID". The method on the business object passes the call on to the data access object that contains the actual SQL SELECT command. This is the "purer" approach, but requires a little extra work.
>
>2. You can place the SQL statements in the business object. The MM .NET data access classes are smart enough to translate parameters for you. For example, if your SQL select statement contains "@" signs, the MM .NET OLE DB data access class converts these to question marks for you...conversely, if your SQL select statement contains question marks, the MM .NET SQL data access class converts these to "@" signs.
>
>Regards,
Previous
Reply
Map
View

Click here to load this message in the networking platform