Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Data Access Layer. Is using sqlhelper.cs bad?

I'm about to start a new .net web project. Previsouly for my n-layer web apps i've used the "Microsoft Data Access Application Block" (sqlhelper.cs) for the data access, then an interface class to interface with the object classes. I'm aware this technique is a bit dated and was looking to use something a little more with the times.

I've looked into LINQ to SQL for data access but was restricted by lacking the many to many relationship. The entity framework was a whole differnet approach that appears to have too larger learning curve.

Would there be anything wrong with using the sqlhelper.cs class to handle my data access?

like image 578
Bevan Avatar asked May 13 '26 10:05

Bevan


1 Answers

Not at all. It supports the creation of multi-tier layers which separates our data access from our logic. I usually have business and data classes in separate folders and include the SqlHelper class with my Data DALC class.

I'm looking forward to the move towards LINQ and the use of generics. That's my next step and I think the the use of the SqlHelper promotes good coding practice in the meantime.

I first started using it when I "borrowed" it from the Enterprise Library which was huge. Ditto for the Entity Framework which I have yet to come to grips with in the workplace. but all in good time :-)

like image 174
IrishChieftain Avatar answered May 15 '26 02:05

IrishChieftain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!