Need help with the DAL

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
mouse_8b
Commander (CMDR)
Commander (CMDR)
Posts: 115
Joined: Mon Oct 11, 2010 1:21 pm
Location: Austin, TX
Contact:

Need help with the DAL

Post by mouse_8b » Wed Jan 11, 2012 2:10 pm

I'm confused. I am trying to figure out how to access the database via an autogenerated DAL. I've read the wiki article, I posted this vague question a few months ago and was directed to this thread.

1st problem: I have downloaded MyGeneration 1.3.1.1, and there are no drivers listed in the Driver box under Connection String. I tried hitting cancel and opening the templates provided from the linked the thread above anyway, but that got me a "no entry point found" error. I googled around and found plenty of people with the same problem, but no solutions. The documentation on MyGeneration's site links to here for the driver. I didn't see anything there that I thought would work, but I'm not real sure what to look for.

Since I haven't been able to get MyGeneration working, I don't really know what to expect it to give me. Am I going to get a class that I simply include and call some sort of load() and save() methods? Looking through some ConLib controls, I can see where LoadForStore() and save() are called, so I assume I would be getting something like those functions.

Are these generated files going to create a new table for me, or do I need to have my new table in place before I deploy generated code? The same question goes to the fields in that table; do I need to set up an empty table with all fields defined before I try to deploy this?

I have some basic SQL experience (using PHP and mySQL). How vital is generating this DAL code? Could I whip up a C# class with all of the SQL specified in my own load() and save() functions? I realize this may not be a good solution, but would it work?

This particular project I am working on now is a scheduler for recurring orders. I built a pretty basic scheduling app and now I have to hook it up to Able. I would need the database to store the objects that represent repeating orders, and I would need enough access to the rest of the database to create an order for a user. It seems like access to Orders and Users and such would come along with "using Commercebuilder.x", is that correct?

I'm good with code, but the more I read about databases, the more I realize I don't know enough about them. I'm also fairly frustrated that I can't get MyGeneration to do anything at all. Any help is appreciated.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Need help with the DAL

Post by jmestep » Thu Jan 12, 2012 9:10 am

It will give you 3 files if you use the template that was uploaded on the forum- an object (like course.cs), a datasource file (like coursedatasourse.cs) and a collection (like coursecollection.cs). You will be getting functions like load(), save(), etc.
You have to create the tables first.
I have used it, I have created dataclasses by hand using copy, paste, replace names.
Some of our developers have started using SubSonic instead, but I haven't done that yet. There is a reference somewhere here on the forum to SubSonic.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply