There are books written on the subject and schools are offering a degree in
ecommerce.
That said, try to use a cart that matches the size of your store. If you
think the store will grow substantially, then get a big cart.
There are many free carts but using one depends on how many products you
have to sell. A very small store will not need a database.
Make sure there is a good back-end administration as well as an image
handler and email/newsletter notification.
Security is important of course and user management interface must be clean
or users will move on.
The bigger the cart the more likely you should acquire some pre-developed
solution.
If you need to use a credit card processing service, then they offer cart
solutions as well.
Other payment solutions for small (or large) stores are Paypal type
services.
a free store is available at
www.asp.net
have fun!