On Wed, May 9, 2012 at 1:10 PM, MB Software Solutions, LLC
<[email protected]> wrote:

> Thanks for that, Steve.  I'm understanding that everything has to be a
> class, right?
------------------

Kind of :)

A class is a construct that enables you to create your own custom
types by grouping together variables of other types, methods and
events. So everything is based off the class System.

That is why you have the using statements in the top of your code.

So from my class I can define a structure for data, or a set of
methods to do work.  yes they could all be in the same class.

You could have a class Customer with methods for .Add .Update, .New etc.

Customer cust =  getCustomer(custID)

public static Customer getCustomer(Int32 ID)
{
  // fill customer data object from ID
using (RingEDIEntities db = new RingEDIEntities())    << Entity Framework here
            {
                var myCust = (from c in db.Customers
                           where c.id == ID
                            select  c
                           ).First();
                return myCust;
            }

}


This does all of the data access to my SQL Server box for me, gets the
row I want and shoots it back to you.

Granted you need a try catch  or an if else in case you get a bad ID
inbound here  :)


-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmylywyd4nkxqykzr_iwbvi4pgea44c6ecob+ti4rcxl...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to